You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2016/04/12 14:06:17 UTC

[2/3] ambari git commit: AMBARI-15823. JS error after fast closing version box popup (onechiporenko)

AMBARI-15823. JS error after fast closing version box popup (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 2619eee168d6ef099117b196585a35fa8e5c2e6c
Parents: c3ea7ef
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Tue Apr 12 11:34:34 2016 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Tue Apr 12 11:34:34 2016 +0300

----------------------------------------------------------------------
 .../admin/stack_upgrade/upgrade_version_box_view.js    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2619eee1/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
index ccee6bf..88bfec2 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
@@ -69,6 +69,8 @@ App.UpgradeVersionBoxView = Em.View.extend({
     return this.get('content.status') === 'CURRENT' ? 'current-version-box' : '';
   }.property('content.status'),
 
+  isPatch: Em.computed.equal('content.type', 'PATCH'),
+
   /**
    * @type {boolean}
    */
@@ -240,6 +242,9 @@ App.UpgradeVersionBoxView = Em.View.extend({
     App.tooltip($('.hosts-tooltip'));
     App.tooltip($('.out-of-sync-badge'), {title: Em.I18n.t('hosts.host.stackVersions.status.out_of_sync')});
     Em.run.later(this, function () {
+      if (this.get('state') !== 'inDOM') {
+        return;
+      }
       if (this.get('maintenanceHosts').length + this.get('notRequiredHosts').length) {
         App.tooltip(this.$('.hosts-section'), {placement: 'bottom', title: Em.I18n.t('admin.stackVersions.version.hostsInfoTooltip').format(
           this.get('maintenanceHosts').length + this.get('notRequiredHosts').length, this.get('maintenanceHosts').length, this.get('notRequiredHosts').length
@@ -248,9 +253,11 @@ App.UpgradeVersionBoxView = Em.View.extend({
     }, 1000);
   },
 
-  isPatch: function() {
-    return this.get('content.type') == "PATCH";
-  }.property('content.type'),
+  willDestroyElement: function () {
+    $('.link-tooltip').tooltip('destroy');
+    $('.hosts-tooltip').tooltip('destroy');
+    $('.out-of-sync-badge').tooltip('destroy');
+  },
 
   /**
    * run custom action of controller