From 633a9f6d61250fbedc4e797e1e2944b20ce7d5b3 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Tue, 18 Feb 2014 10:30:44 -0500 Subject: [PATCH] AC-564 fixed a bug with CodeMirror editor and post dialog removal/cleanup. --- awx/ui/static/js/controllers/Inventories.js | 2 +- awx/ui/static/js/helpers/Parse.js | 1 + awx/ui/static/lib/ansible/Utilities.js | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/awx/ui/static/js/controllers/Inventories.js b/awx/ui/static/js/controllers/Inventories.js index 500591135b..62ef547bf9 100644 --- a/awx/ui/static/js/controllers/Inventories.js +++ b/awx/ui/static/js/controllers/Inventories.js @@ -238,7 +238,7 @@ function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $routePar generator.reset(); LoadBreadCrumbs(); - + $scope.inventoryParseType = 'yaml'; ParseTypeChange({ scope: $scope, variable: 'inventory_variables', parse_variable: 'inventoryParseType', field_id: 'inventory_inventory_variables' }); diff --git a/awx/ui/static/js/helpers/Parse.js b/awx/ui/static/js/helpers/Parse.js index 432de6d8b0..54c5c34414 100644 --- a/awx/ui/static/js/helpers/Parse.js +++ b/awx/ui/static/js/helpers/Parse.js @@ -32,6 +32,7 @@ angular.module('ParseHelper', ['Utilities', 'AngularCodeMirrorModule']) //hide the textarea and show a fresh CodeMirror with the current mode (json or yaml) codeMirror = AngularCodeMirror(); codeMirror.addModes($AnsibleConfig.variable_edit_modes); + console.log('here'); codeMirror.showTextArea({ scope: scope, model: fld, element: field_id, mode: scope[pfld], onReady: onReady, onChange: onChange }); } diff --git a/awx/ui/static/lib/ansible/Utilities.js b/awx/ui/static/lib/ansible/Utilities.js index 2ea94c3ec8..a200acc90c 100644 --- a/awx/ui/static/lib/ansible/Utilities.js +++ b/awx/ui/static/lib/ansible/Utilities.js @@ -19,6 +19,10 @@ angular.module('Utilities', ['RestServices', 'Utilities']) .factory('ClearScope', [ function () { return function () { + + $('#form-modal .modal-body').empty(); + $('#form-modal2 .modal-body').empty(); + $('.tooltip').each(function () { $(this).remove(); });