Code organization

This commit is contained in:
Akita Noek
2016-06-02 16:57:11 -04:00
parent e0a00a8705
commit 93ccbdc872

View File

@@ -83,6 +83,13 @@ export default
}); });
} }
function sync_verbosity_select2() {
CreateSelect2({
element:'#job_templates_verbosity',
multiple: false
});
}
getPlaybooks = function (project) { getPlaybooks = function (project) {
var url; var url;
if ($scope.playbook) { if ($scope.playbook) {
@@ -243,6 +250,8 @@ export default
} }
}); });
// watch for changes to 'verbosity', ensure we keep our select2 in sync when it changes.
$scope.$watch('verbosity', sync_verbosity_select2);
// Turn off 'Wait' after both cloud credential and playbook list come back // Turn off 'Wait' after both cloud credential and playbook list come back
@@ -399,15 +408,6 @@ export default
}); });
// setup verbosity options lookup // setup verbosity options lookup
function sync_verbosity_select2() {
CreateSelect2({
element:'#job_templates_verbosity',
multiple: false
});
}
$scope.$watch('verbosity', sync_verbosity_select2);
sync_verbosity_select2();
GetChoices({ GetChoices({
scope: $scope, scope: $scope,
url: defaultUrl, url: defaultUrl,
@@ -415,6 +415,7 @@ export default
variable: 'verbosity_options', variable: 'verbosity_options',
callback: 'choicesReady' callback: 'choicesReady'
}); });
sync_verbosity_select2();
// setup job type options lookup // setup job type options lookup
GetChoices({ GetChoices({