ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject git commit: AMBARI-7264. Dashboard widgets on moving strangeness. (akovalenko)
Date Thu, 11 Sep 2014 16:43:32 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b0fee6d4c -> 701165b66


AMBARI-7264. Dashboard widgets on moving strangeness. (akovalenko)


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

Branch: refs/heads/trunk
Commit: 701165b66eff9214ed22d65f0e2c2b8c62f0137c
Parents: b0fee6d
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Thu Sep 11 19:39:15 2014 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Thu Sep 11 19:43:06 2014 +0300

----------------------------------------------------------------------
 .../main/dashboard/widgets/cluster_metrics.hbs        |  2 +-
 .../templates/main/dashboard/widgets/hbase_links.hbs  |  2 +-
 .../templates/main/dashboard/widgets/hdfs_links.hbs   |  2 +-
 .../main/dashboard/widgets/mapreduce_links.hbs        |  2 +-
 .../main/dashboard/widgets/mapreduce_slots.hbs        |  2 +-
 .../templates/main/dashboard/widgets/pie_chart.hbs    |  2 +-
 .../templates/main/dashboard/widgets/simple_text.hbs  |  2 +-
 .../app/templates/main/dashboard/widgets/uptime.hbs   |  2 +-
 ambari-web/app/views/main/dashboard/widget.js         |  4 ++--
 ambari-web/app/views/main/dashboard/widgets.js        | 14 ++++++++++++++
 10 files changed, 24 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs b/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
index eef559d..6156906 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
@@ -19,7 +19,7 @@
 <div class="cluster-metrics">
   <ul>
     <li class="thumbnail row">
-      <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+      <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action deleteWidget target="view"}}>
           <i class="icon-remove-sign icon-large"></i>
       </a>
       <div class="caption span10">{{view.title}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
index d7501f4..66d5d23 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
@@ -19,7 +19,7 @@
 <div class="links">
   <ul>
     <li class="thumbnail row">
-      <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}><i
class="icon-remove-sign icon-large"></i></a>
+      <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action deleteWidget target="view"}}><i class="icon-remove-sign icon-large"></i></a>
       <div class="caption span10"> {{view.title}}</div>
 
       <div class="widget-content" >

http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
index 2d26c3a..9be5ba4 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
@@ -19,7 +19,7 @@
 <div class="links">
   <ul>
   <li class="thumbnail row">
-    <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+    <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action deleteWidget target="view"}}>
       <i class="icon-remove-sign icon-large"></i>
     </a>
     <div class="caption span10"> {{view.title}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
index 15c8a18..13d6f41 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
@@ -19,7 +19,7 @@
 <div class="links">
   <ul>
     <li class="thumbnail row">
-      <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+      <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action deleteWidget target="view"}}>
         <i class="icon-remove-sign icon-large"></i>
       </a>
       <div class="caption span10"> {{view.title}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/mapreduce_slots.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/mapreduce_slots.hbs b/ambari-web/app/templates/main/dashboard/widgets/mapreduce_slots.hbs
index 26f61ba..90b8c27 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/mapreduce_slots.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/mapreduce_slots.hbs
@@ -19,7 +19,7 @@
 <div class="has-hidden-info">
   <ul>
     <li class="thumbnail row" >
-      <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}><i
class="icon-remove-sign icon-large"></i></a>
+      <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} {{action
deleteWidget target="view"}}><i class="icon-remove-sign icon-large"></i></a>
       <div class="caption span10 slots-caption"> {{view.title}}</div>
 
       <div {{bindAttr class=":hidden-info-general view.hiddenInfoClass"}}>

http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs b/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
index b73a77c..6af3a01 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
@@ -19,7 +19,7 @@
 <div class="has-hidden-info">
   <ul>
     <li class="thumbnail row">
-      <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+      <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action deleteWidget target="view"}}>
         <i class="icon-remove-sign icon-large"></i>
       </a>
       <div class="caption span10">{{view.title}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs b/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
index 845a938..4b14113 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
@@ -19,7 +19,7 @@
 <div class="has-hidden-info">
   <ul>
     <li class="thumbnail row" >
-      <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+      <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action deleteWidget target="view"}}>
         <i class="icon-remove-sign icon-large"></i>
       </a>
       <div class="caption span10"> {{view.title}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs b/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
index ce356a1..9ea9e8b 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
@@ -19,7 +19,7 @@
 <div class="has-hidden-info">
   <ul>
     <li class="thumbnail row" >
-      <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+      <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#"
{{action deleteWidget target="view"}}>
         <i class="icon-remove-sign icon-large"></i>
       </a>
       <div class="caption span11"> {{view.title}} </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/views/main/dashboard/widget.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widget.js b/ambari-web/app/views/main/dashboard/widget.js
index 7561a99..95fc5fb 100644
--- a/ambari-web/app/views/main/dashboard/widget.js
+++ b/ambari-web/app/views/main/dashboard/widget.js
@@ -139,7 +139,7 @@ App.DashboardWidgetView = Em.View.extend({
 
     });
 
-    var browserVerion = this.getInternetExplorerVersion();
+    var browserVersion = this.getInternetExplorerVersion();
     App.ModalPopup.show({
       header: Em.I18n.t('dashboard.widgets.popupHeader'),
       classNames: [ 'sixty-percent-width-modal-edit-widget' ],
@@ -172,7 +172,7 @@ App.DashboardWidgetView = Em.View.extend({
         var handlers = [configObj.get('thresh1'), configObj.get('thresh2')];
         var colors = ['#95A800', '#FF8E00', '#B80000']; //color green, orange ,red
 
-        if (browserVerion == -1 || browserVerion > 9) {
+        if (browserVersion == -1 || browserVersion > 9) {
           configObj.set('isIE9', false);
           configObj.set('isGreenOrangeRed', true);
           $("#slider-range").slider({

http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/views/main/dashboard/widgets.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets.js b/ambari-web/app/views/main/dashboard/widgets.js
index 01c229c..374793b 100644
--- a/ambari-web/app/views/main/dashboard/widgets.js
+++ b/ambari-web/app/views/main/dashboard/widgets.js
@@ -45,6 +45,12 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage,
{
   isDataLoaded: false,
 
   /**
+   * Define if some widget is currently moving
+   * @type {bool}
+   */
+  isMoving: false,
+
+  /**
    * Make widgets' list sortable on New Dashboard style
    */
   makeSortable: function () {
@@ -53,6 +59,8 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage,
{
       items: "> div",
       //placeholder: "sortable-placeholder",
       cursor: "move",
+      tolerance: "pointer",
+      scroll: false,
       update: function (event, ui) {
         if (!App.get('testMode')) {
           // update persist then translate to real
@@ -76,6 +84,12 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage,
{
             //self.translateToReal(newValue);
           });
         }
+      },
+      activate: function(event, ui) {
+        self.set('isMoving', true);
+      },
+      deactivate: function(event, ui) {
+        self.set('isMoving', false);
       }
     }).disableSelection();
   },


Mime
View raw message