ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject [2/2] ambari git commit: AMBARI-10582. Clicking on cancel icon on the widget should hide it(XIWANG)
Date Sat, 18 Apr 2015 00:41:34 GMT
AMBARI-10582. Clicking on cancel icon on the widget should hide it(XIWANG)


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

Branch: refs/heads/trunk
Commit: 871981252da501cecb33290a4e191be0b66c595a
Parents: fc5b29f
Author: Xi Wang <xiwang@apache.org>
Authored: Fri Apr 17 15:49:51 2015 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Fri Apr 17 17:36:30 2015 -0700

----------------------------------------------------------------------
 .../app/controllers/main/service/info/summary.js      |  4 ++++
 ambari-web/app/mixins/common/widget_mixin.js          | 14 ++++++++++----
 .../app/templates/common/widget/gauge_widget.hbs      |  2 +-
 .../app/templates/common/widget/graph_widget.hbs      |  2 +-
 .../app/templates/common/widget/number_widget.hbs     |  2 +-
 .../app/templates/common/widget/template_widget.hbs   |  2 +-
 .../app/templates/main/service/info/summary.hbs       |  2 +-
 7 files changed, 19 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/87198125/ambari-web/app/controllers/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/summary.js b/ambari-web/app/controllers/main/service/info/summary.js
index 696d2c9..054ab31 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -331,6 +331,10 @@ App.MainServiceInfoSummaryController = Em.Controller.extend({
    * @type {boolean}
    */
   isAllSharedWidgetsLoaded: false,
+
+  /**
+   * @type {boolean}
+   */
   isMineWidgetsLoaded: false,
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/87198125/ambari-web/app/mixins/common/widget_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widget_mixin.js b/ambari-web/app/mixins/common/widget_mixin.js
index 35b11b1..33d81fc 100644
--- a/ambari-web/app/mixins/common/widget_mixin.js
+++ b/ambari-web/app/mixins/common/widget_mixin.js
@@ -316,20 +316,26 @@ App.WidgetMixin = Ember.Mixin.create({
   /*
    * make call when clicking on "remove icon" on widget
    */
-  hideWidget: function () {
-
+  hideWidget: function (event) {
+    this.get('controller').hideWidget(
+      {
+        context: Em.Object.create({
+          id: event.context
+        })
+      }
+    );
   },
   /*
    * make call when clicking on "clone icon" on widget
    */
-  cloneWidget: function () {
+  cloneWidget: function (event) {
 
   },
 
   /*
    * make call when clicking on "edit icon" on widget
    */
-  editWidget: function () {
+  editWidget: function (event) {
 
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/87198125/ambari-web/app/templates/common/widget/gauge_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/widget/gauge_widget.hbs b/ambari-web/app/templates/common/widget/gauge_widget.hbs
index 1846670..3dd54c1 100644
--- a/ambari-web/app/templates/common/widget/gauge_widget.hbs
+++ b/ambari-web/app/templates/common/widget/gauge_widget.hbs
@@ -18,7 +18,7 @@
 
 <div class="gauge-widget thumbnail">
   {{#if view.isLoaded}}
-    <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action hideWidget target="view"}}>
+    <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action hideWidget view.id target="view"}}>
       <i class="icon-remove-sign icon-large"></i>
     </a>
     <div class="caption title span9">{{view.content.displayName}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/87198125/ambari-web/app/templates/common/widget/graph_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/widget/graph_widget.hbs b/ambari-web/app/templates/common/widget/graph_widget.hbs
index ede376f..9c1560f 100644
--- a/ambari-web/app/templates/common/widget/graph_widget.hbs
+++ b/ambari-web/app/templates/common/widget/graph_widget.hbs
@@ -18,7 +18,7 @@
 
 <div class="graph-widget thumbnail">
   {{#if view.isLoaded}}
-    <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action hideWidget target="view"}}>
+    <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action hideWidget view.id target="view"}}>
       <i class="icon-remove-sign icon-large"></i>
     </a>
     <div class="caption title span9">{{view.content.displayName}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/87198125/ambari-web/app/templates/common/widget/number_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/widget/number_widget.hbs b/ambari-web/app/templates/common/widget/number_widget.hbs
index be32201..d1bdc97 100644
--- a/ambari-web/app/templates/common/widget/number_widget.hbs
+++ b/ambari-web/app/templates/common/widget/number_widget.hbs
@@ -18,7 +18,7 @@
 
 <div class="number-widget thumbnail">
   {{#if view.isLoaded}}
-    <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action hideWidget target="view"}}>
+    <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action hideWidget view.id target="view"}}>
       <i class="icon-remove-sign icon-large"></i>
     </a>
     <div class="caption title span9">{{view.content.displayName}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/87198125/ambari-web/app/templates/common/widget/template_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/widget/template_widget.hbs b/ambari-web/app/templates/common/widget/template_widget.hbs
index 4e2ea0b..c4f9597 100644
--- a/ambari-web/app/templates/common/widget/template_widget.hbs
+++ b/ambari-web/app/templates/common/widget/template_widget.hbs
@@ -18,7 +18,7 @@
 
 <div class="template-widget thumbnail">
   {{#if view.isLoaded}}
-    <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action hideWidget target="view"}}>
+    <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action hideWidget view.id target="view"}}>
       <i class="icon-remove-sign icon-large"></i>
     </a>
     <div class="caption title span9">{{view.content.displayName}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/87198125/ambari-web/app/templates/main/service/info/summary.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary.hbs b/ambari-web/app/templates/main/service/info/summary.hbs
index 2c2668c..8567b76 100644
--- a/ambari-web/app/templates/main/service/info/summary.hbs
+++ b/ambari-web/app/templates/main/service/info/summary.hbs
@@ -126,7 +126,7 @@
               <div id="widget_layout" class="row-fluid">
                 {{#each widget in controller.widgets}}
                   <div class="widget span2p4" {{bindAttr id="widget.id"}}>
-                    {{view widget.viewClass contentBinding="widget"}}
+                    {{view widget.viewClass contentBinding="widget" idBinding="widget.id"}}
                   </div>
                 {{/each}}
                 <div class="span2p4">


Mime
View raw message