Merge pull request #613 from jaredevantabor/fix-569

removing codemirror instantiation from $transition event
This commit is contained in:
Jared Tabor 2017-11-14 11:09:41 -08:00 committed by GitHub
commit 5852c16ba6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 34 deletions

View File

@ -6,10 +6,8 @@
export default ['$state', '$stateParams', '$scope', 'ParseVariableString', 'rbacUiControlService', 'ToJSON',
'ParseTypeChange', 'GroupsService', 'GetChoices', 'GetBasePath', 'CreateSelect2', 'groupData', '$rootScope',
'$transitions',
function($state, $stateParams, $scope, ParseVariableString, rbacUiControlService, ToJSON,
ParseTypeChange, GroupsService, GetChoices, GetBasePath, CreateSelect2, groupData, $rootScope,
$transitions) {
ParseTypeChange, GroupsService, GetChoices, GetBasePath, CreateSelect2, groupData, $rootScope) {
init();
@ -32,14 +30,11 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString', 'rbac
$scope.parseType = 'yaml';
$scope.envParseType = 'yaml';
$transitions.onSuccess({}, function(trans) {
if(trans.to().name === 'inventories.edit.groups.edit') {
ParseTypeChange({
scope: $scope,
field_id: 'group_group_variables',
variable: 'group_variables',
});
}
ParseTypeChange({
scope: $scope,
field_id: 'group_group_variables',
variable: 'group_variables',
});
}

View File

@ -8,7 +8,7 @@ function SmartInventoryEdit($scope, $location,
$stateParams, InventoryForm, Rest, ProcessErrors,
GetBasePath, ParseTypeChange, Wait, ToJSON,
ParseVariableString, $state, OrgAdminLookup, resourceData,
$rootScope, InstanceGroupsService, InstanceGroupsData, $transitions) {
$rootScope, InstanceGroupsService, InstanceGroupsData) {
// Inject dynamic view
var defaultUrl = GetBasePath('inventory'),
@ -37,15 +37,12 @@ function SmartInventoryEdit($scope, $location,
$scope.parseType = 'yaml';
$transitions.onSuccess({}, function(trans) {
if(trans.to().name === 'inventories.editSmartInventory') {
ParseTypeChange({
scope: $scope,
variable: 'smartinventory_variables',
parse_variable: 'parseType',
field_id: 'smartinventory_smartinventory_variables'
});
}
ParseTypeChange({
scope: $scope,
variable: 'smartinventory_variables',
parse_variable: 'parseType',
field_id: 'smartinventory_smartinventory_variables'
});
OrgAdminLookup.checkForAdminAccess({organization: inventoryData.organization})
@ -109,5 +106,5 @@ export default [ '$scope', '$location',
'ProcessErrors', 'GetBasePath', 'ParseTypeChange', 'Wait',
'ToJSON', 'ParseVariableString',
'$state', 'OrgAdminLookup', 'resourceData',
'$rootScope', 'InstanceGroupsService', 'InstanceGroupsData', '$transitions', SmartInventoryEdit
'$rootScope', 'InstanceGroupsService', 'InstanceGroupsData', SmartInventoryEdit
];

View File

@ -14,8 +14,7 @@ function InventoriesEdit($scope, $location,
$stateParams, InventoryForm, Rest, ProcessErrors,
GetBasePath, ParseTypeChange, Wait, ToJSON,
ParseVariableString, $state, OrgAdminLookup, $rootScope, resourceData,
CreateSelect2, InstanceGroupsService, InstanceGroupsData, CanRemediate,
$transitions) {
CreateSelect2, InstanceGroupsService, InstanceGroupsData, CanRemediate) {
// Inject dynamic view
let defaultUrl = GetBasePath('inventory'),
@ -41,15 +40,11 @@ function InventoriesEdit($scope, $location,
$scope.instance_groups = InstanceGroupsData;
$scope.canRemediate = CanRemediate;
$transitions.onSuccess({}, function(trans) {
if(trans.to().name === 'inventories.edit') {
ParseTypeChange({
scope: $scope,
variable: 'inventory_variables',
parse_variable: 'parseType',
field_id: 'inventory_inventory_variables'
});
}
ParseTypeChange({
scope: $scope,
variable: 'inventory_variables',
parse_variable: 'parseType',
field_id: 'inventory_inventory_variables'
});
OrgAdminLookup.checkForAdminAccess({organization: inventoryData.organization})
@ -120,5 +115,5 @@ export default ['$scope', '$location',
'ToJSON', 'ParseVariableString',
'$state', 'OrgAdminLookup', '$rootScope', 'resourceData', 'CreateSelect2',
'InstanceGroupsService', 'InstanceGroupsData', 'CanRemediate',
'$transitions', InventoriesEdit,
InventoriesEdit,
];