Fixing scope passed to CodeMirror factory on hosts route

This commit is contained in:
Jared Tabor 2016-03-31 12:00:28 -07:00
parent 359da2d958
commit c51501223c
2 changed files with 14 additions and 12 deletions

View File

@ -453,7 +453,7 @@ function manageGroupsDirectiveController($filter, $rootScope, $location, $log, $
// Cancel
modal_scope.cancelPanel = function() {
Wait('stop');
$state.go('inventoryManage', {}, {reload: true})
$state.go('inventoryManage', {}, {reload: true});
};
// Save
@ -539,7 +539,7 @@ function manageGroupsDirectiveController($filter, $rootScope, $location, $log, $
angular.extend(vm, {
cancelPanel : modal_scope.cancelPanel,
saveGroup: modal_scope.saveGroup
})
});
}
export default ['$filter', '$rootScope', '$location', '$log', '$stateParams', '$compile', '$state', '$scope', 'Rest', 'Alert', 'GroupForm', 'GenerateForm',

View File

@ -40,16 +40,6 @@ function manageHostsDirectiveController($rootScope, $location, $log, $stateParam
cancelButton: false
});
generator.reset();
console.info(angular.element(document.getElementById('host_variables')));
$scope.parseType = 'yaml';
ParseTypeChange({
scope: form_scope,
variable: 'variables',
parse_variable: 'parseType',
field_id: 'host_variables'
});
// Retrieve detail record and prepopulate the form
if (mode === 'edit') {
@ -75,6 +65,12 @@ function manageHostsDirectiveController($rootScope, $location, $log, $stateParam
}
scope.variable_url = data.related.variable_data;
scope.has_inventory_sources = data.has_inventory_sources;
scope.parseType = 'yaml';
ParseTypeChange({
scope: scope,
field_id: 'host_variables',
});
})
.error(function(data, status) {
ProcessErrors(parent_scope, data, status, form, {
@ -99,6 +95,12 @@ function manageHostsDirectiveController($rootScope, $location, $log, $stateParam
scope.variables = '---';
defaultUrl = data.related.hosts;
//scope.$emit('hostVariablesLoaded');
scope.parseType = 'yaml';
ParseTypeChange({
scope: scope,
field_id: 'host_variables',
});
})
.error(function(data, status) {
ProcessErrors(parent_scope, data, status, form, {