You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2015/06/13 03:27:40 UTC

ambari git commit: AMBARI-11897. Widgets: cannot see metric names. (jaimin)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 033ea9c87 -> b85ef2abf


AMBARI-11897. Widgets: cannot see metric names. (jaimin)


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

Branch: refs/heads/branch-2.1
Commit: b85ef2abf76bdbc2ecffeb01027b1912d8944da4
Parents: 033ea9c
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Fri Jun 12 18:27:06 2015 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Fri Jun 12 18:27:06 2015 -0700

----------------------------------------------------------------------
 .../app/styles/enhanced_service_dashboard.less   |  1 +
 ambari-web/app/views/common/chosen_plugin.js     | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b85ef2ab/ambari-web/app/styles/enhanced_service_dashboard.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/enhanced_service_dashboard.less b/ambari-web/app/styles/enhanced_service_dashboard.less
index 92250d5..1cb687a 100644
--- a/ambari-web/app/styles/enhanced_service_dashboard.less
+++ b/ambari-web/app/styles/enhanced_service_dashboard.less
@@ -588,6 +588,7 @@
     .chosen-drop {
       margin-top: 2px;
       overflow: auto;
+      min-width: 300px;
       width: 300px;
       border: 1px solid rgba(0, 0, 0, 0.2);
       -webkit-border-radius: 0px;

http://git-wip-us.apache.org/repos/asf/ambari/blob/b85ef2ab/ambari-web/app/views/common/chosen_plugin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/chosen_plugin.js b/ambari-web/app/views/common/chosen_plugin.js
index e9b9fbe..95f6c1e 100644
--- a/ambari-web/app/views/common/chosen_plugin.js
+++ b/ambari-web/app/views/common/chosen_plugin.js
@@ -41,5 +41,24 @@ App.JqueryChosenView = Em.View.extend({
       placeholder_text: self.get('selectionObj.placeholder_text'),
       no_results_text: self.get('selectionObj.no_results_text')
     }).change(self.get('selectionObj.onChangeCallback'));
+
+    // Expand the dropdown to accommodate the largest option on mouseenter event
+    // and reset it to the original fixed width on the mouseleave event
+    Em.run.later(this, function() {
+      var chosenDropDownId = elementId + '_chosen' + ' .chosen-drop';
+      var chosenDropDownEl;
+      $(chosenDropDownId)
+        .each(function() {
+          chosenDropDownEl = $(this);
+          chosenDropDownEl.data("origWidth", chosenDropDownEl.outerWidth());
+        })
+        .mouseenter(function(){
+          $(this).css("width", "auto");
+        })
+        .mouseleave(function(){
+          chosenDropDownEl = $(this);
+          chosenDropDownEl.css("width", chosenDropDownEl.data("origWidth"));
+        });
+    }, 1000);
   }
 });
\ No newline at end of file