ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject git commit: AMBARI-7531. Configs: configs button bar floats and unable to access save button.(xiwang)
Date Mon, 29 Sep 2014 22:25:04 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk a6ad0f762 -> cc9adeeb1


AMBARI-7531. Configs: configs button bar floats and unable to access save button.(xiwang)


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

Branch: refs/heads/trunk
Commit: cc9adeeb1eb10919cd9769b22157430102160f2d
Parents: a6ad0f7
Author: Xi Wang <xiwang@apache.org>
Authored: Fri Sep 26 18:22:17 2014 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Mon Sep 29 15:23:59 2014 -0700

----------------------------------------------------------------------
 .../views/common/configs/config_history_flow.js  | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cc9adeeb/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index 92057ac..4e026e5 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -256,22 +256,25 @@ App.ConfigHistoryFlowView = Em.View.extend({
    * initialize event to keep info bar position at the top of the page
    */
   keepInfoBarAtTop: function () {
-    var defaultTop;
+    var defaultTop, defaultLeft;
     var self = this;
     //reset defaultTop value in closure
     $(window).unbind('scroll');
 
     $(window).on('scroll', function (event) {
       var infoBar = $('#config_history_flow>.version-info-bar-wrapper');
+      var versionSlider = $('#config_history_flow>.version-slider');
       var scrollTop = $(window).scrollTop();
-
+      var scrollLeft = $(window).scrollLeft();
       if (infoBar.length === 0) {
         $(window).unbind('scroll');
         return;
       }
       //290 - default "top" property in px
       defaultTop = defaultTop || (infoBar.get(0).getBoundingClientRect() && infoBar.get(0).getBoundingClientRect().top)
|| 290;
-      self.setInfoBarPosition(infoBar, defaultTop, scrollTop);
+      // keep the version info bar always aligned to version slider
+      defaultLeft = (versionSlider.get(0).getBoundingClientRect() && versionSlider.get(0).getBoundingClientRect().left);
+      self.setInfoBarPosition(infoBar, defaultTop, scrollTop, defaultLeft, scrollLeft);
     })
   },
   /**
@@ -279,8 +282,10 @@ App.ConfigHistoryFlowView = Em.View.extend({
    * @param infoBar
    * @param defaultTop
    * @param scrollTop
+   * @param defaultLeft
+   * @param scrollLeft
    */
-  setInfoBarPosition: function (infoBar, defaultTop, scrollTop) {
+  setInfoBarPosition: function (infoBar, defaultTop, scrollTop, defaultLeft, scrollLeft)
{
     if (scrollTop > defaultTop) {
       infoBar.css('top', '10px');
     } else if (scrollTop > 0) {
@@ -288,7 +293,13 @@ App.ConfigHistoryFlowView = Em.View.extend({
     } else {
       infoBar.css('top', 'auto');
     }
+    if (scrollLeft > 0) {
+      infoBar.css('left', defaultLeft);
+    } else {
+      infoBar.css('left', 'auto');
+    }
   },
+
   /**
    *  define the first element in viewport
    *  change visibility of arrows


Mime
View raw message