ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject [2/2] ambari git commit: AMBARI-12554. FE: Switching between different service's configs does not reduce DOM node and listeners count (akovalenko)
Date Mon, 27 Jul 2015 16:33:01 GMT
AMBARI-12554. FE: Switching between different service's configs does not reduce DOM node and
listeners count (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5b57ed59
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5b57ed59
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5b57ed59

Branch: refs/heads/branch-2.1
Commit: 5b57ed59f680ab370291b92c86a6c1e1ffcebafd
Parents: c9fb3fe
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Mon Jul 27 19:32:47 2015 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Mon Jul 27 19:32:47 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/info/configs.js | 12 ++++++++++--
 ambari-web/app/utils/helper.js                          |  2 ++
 .../app/views/common/configs/service_config_view.js     |  1 +
 3 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5b57ed59/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index de9f741..c53095f 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -164,6 +164,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
    * @type {boolean}
    */
   isSubmitDisabled: function () {
+    if (!this.get('selectedService')) return true;
     return this.get('selectedService').get('errorCount') !==  0 || this.get('saveInProgress');
   }.property('selectedService.errorCount', 'saveInProgress'),
 
@@ -274,8 +275,15 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
       serviceConfigVersionNote: ''
     });
     this.get('filterColumns').setEach('selected', false);
-    this.get('stepConfigs').clear();
-    this.get('allConfigs').clear();
+    this.clearConfigs();
+  },
+
+  clearConfigs: function() {
+    this.get('allConfigs').invoke('destroy');
+    this.get('stepConfigs').invoke('destroy');
+    this.set('stepConfigs', []);
+    this.set('allConfigs', []);
+    this.set('selectedService', null);
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/5b57ed59/ambari-web/app/utils/helper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/helper.js b/ambari-web/app/utils/helper.js
index 0e454d6..04f767d 100644
--- a/ambari-web/app/utils/helper.js
+++ b/ambari-web/app/utils/helper.js
@@ -580,6 +580,7 @@ App.popover = function (self, options) {
   self.popover(options);
   self.on("remove", function () {
     $(this).trigger('mouseleave');
+    $(this).off();
   });
 };
 
@@ -597,6 +598,7 @@ App.tooltip = function (self, options) {
   /* istanbul ignore next */
   self.on("remove", function () {
     $(this).trigger('mouseleave');
+    $(this).off();
   });
 };
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/5b57ed59/ambari-web/app/views/common/configs/service_config_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/service_config_view.js b/ambari-web/app/views/common/configs/service_config_view.js
index c9da165..47349c6 100644
--- a/ambari-web/app/views/common/configs/service_config_view.js
+++ b/ambari-web/app/views/common/configs/service_config_view.js
@@ -250,6 +250,7 @@ App.ServiceConfigView = Em.View.extend({
    * @method filterEnhancedConfigs
    */
   filterEnhancedConfigs: function () {
+    if (!this.get('controller.selectedService')) return true;
     var self = this;
 
     var serviceConfigs = this.get('controller.selectedService.configs').filterProperty('isVisible',
true);


Mime
View raw message