ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-14787 Widgets doesn't load on Summary page layout after new ones are created. (ababiichuk)
Date Tue, 26 Jan 2016 17:56:55 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 a189609ce -> a1ec65d50


AMBARI-14787 Widgets doesn't load on Summary page layout after new ones are created. (ababiichuk)


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

Branch: refs/heads/branch-2.2
Commit: a1ec65d50a0ce763718ca73e2f236d551782090e
Parents: a189609
Author: ababiichuk <ababiichuk@hortonworks.com>
Authored: Mon Jan 25 17:05:45 2016 +0200
Committer: ababiichuk <ababiichuk@hortonworks.com>
Committed: Tue Jan 26 19:54:46 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/mixins/common/widgets/widget_mixin.js   | 9 +++++++++
 ambari-web/app/mixins/common/widgets/widget_section.js | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a1ec65d5/ambari-web/app/mixins/common/widgets/widget_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widgets/widget_mixin.js b/ambari-web/app/mixins/common/widgets/widget_mixin.js
index c639c77..97cf386 100644
--- a/ambari-web/app/mixins/common/widgets/widget_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js
@@ -379,6 +379,12 @@ App.WidgetMixin = Ember.Mixin.create({
     }
   }.observes('isLoaded'),
 
+  willDestroyElement: function() {
+    this.$(".corner-icon > .icon-copy").tooltip('destroy');
+    this.$(".corner-icon > .icon-edit").tooltip('destroy');
+    this.$(".corner-icon > .icon-save").tooltip('destroy');
+  },
+
   /**
    * calculate series datasets for graph widgets
    */
@@ -669,6 +675,9 @@ App.WidgetLoadAggregator = Em.Object.create({
     this.get('requests').push(request);
     if (Em.isNone(this.get('timeoutId'))) {
       this.set('timeoutId', window.setTimeout(function () {
+        //clear requests that are belongs to destroyed views
+        self.set('requests', self.get('requests').filterProperty('context.state', 'inDOM'));
+
         self.runRequests(self.get('requests'));
         self.get('requests').clear();
         clearTimeout(self.get('timeoutId'));

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1ec65d5/ambari-web/app/mixins/common/widgets/widget_section.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widgets/widget_section.js b/ambari-web/app/mixins/common/widgets/widget_section.js
index 81d9f70..abd0c97 100644
--- a/ambari-web/app/mixins/common/widgets/widget_section.js
+++ b/ambari-web/app/mixins/common/widgets/widget_section.js
@@ -178,7 +178,7 @@ App.WidgetSectionMixin = Ember.Mixin.create({
     if (data) {
       App.widgetMapper.map(data.items[0].WidgetLayoutInfo);
       App.widgetLayoutMapper.map(data);
-      this.set('activeWidgetLayout', App.WidgetLayout.find().findProperty('id', data.items[0].WidgetLayoutInfo.id));
+      this.set('activeWidgetLayout', App.WidgetLayout.find(data.items[0].WidgetLayoutInfo.id));
       this.set('isWidgetsLoaded', true);
     }
   },


Mime
View raw message