fix home > hosts codemirror instance, resolves #2954 (#2960)

This commit is contained in:
Leigh Johnson
2016-07-12 17:32:21 -04:00
committed by GitHub
parent 5d72240d35
commit b6504da90e

View File

@@ -22,7 +22,7 @@
$scope.formSave = function(){ $scope.formSave = function(){
var host = { var host = {
id: $scope.host.id, id: $scope.host.id,
variables: $scope.extraVars === '---' || $scope.extraVars === '{}' ? null : $scope.extraVars, variables: $scope.variables === '---' || $scope.variables === '{}' ? null : $scope.variables,
name: $scope.name, name: $scope.name,
description: $scope.description, description: $scope.description,
enabled: $scope.host.enabled enabled: $scope.host.enabled
@@ -34,15 +34,14 @@
}; };
var init = function(){ var init = function(){
$scope.host = host; $scope.host = host;
$scope.extraVars = host.variables === '' ? '---' : host.variables;
generator.inject(form, {mode: 'edit', related: false, scope: $scope}); generator.inject(form, {mode: 'edit', related: false, scope: $scope});
$scope.extraVars = $scope.host.variables === '' ? '---' : $scope.host.variables;
$scope.name = host.name; $scope.name = host.name;
$scope.description = host.description; $scope.description = host.description;
$scope.variables = host.variables === '' ? '---' : host.variables;
ParseTypeChange({ ParseTypeChange({
scope: $scope, scope: $scope,
field_id: 'host_variables', field_id: 'host_variables',
variable: 'extraVars', variable: 'variables',
}); });
}; };