ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject ambari git commit: AMBARI-20464. Side Nav: several issues and adjustments.(xiwang)
Date Thu, 16 Mar 2017 21:25:58 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 5d629dc1e -> 9ed8c72f7


AMBARI-20464. Side Nav: several issues and adjustments.(xiwang)


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

Branch: refs/heads/trunk
Commit: 9ed8c72f758380003853ba477f623c192b806896
Parents: 5d629dc
Author: Xi Wang <xiwang@apache.org>
Authored: Wed Mar 15 11:26:11 2017 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Thu Mar 16 14:25:41 2017 -0700

----------------------------------------------------------------------
 .../app/styles/theme/bootstrap-ambari.css       |  7 ++++--
 .../vendor/scripts/theme/bootstrap-ambari.js    | 26 ++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9ed8c72f/ambari-web/app/styles/theme/bootstrap-ambari.css
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/theme/bootstrap-ambari.css b/ambari-web/app/styles/theme/bootstrap-ambari.css
index 98606e9..6a353a2 100644
--- a/ambari-web/app/styles/theme/bootstrap-ambari.css
+++ b/ambari-web/app/styles/theme/bootstrap-ambari.css
@@ -1009,8 +1009,11 @@ input.radio:checked + label:after {
 .navigation-bar-container ul.nav.side-nav-footer .more-actions {
   display: none;
   position: absolute;
-  top: 20px;
-  right: 35px;
+  top: 14px;
+  right: 33px;
+  line-height: 25px;
+  width: 20px;
+  text-align: center;
   line-height: 14px;
   font-size: 14px;
   cursor: pointer;

http://git-wip-us.apache.org/repos/asf/ambari/blob/9ed8c72f/ambari-web/vendor/scripts/theme/bootstrap-ambari.js
----------------------------------------------------------------------
diff --git a/ambari-web/vendor/scripts/theme/bootstrap-ambari.js b/ambari-web/vendor/scripts/theme/bootstrap-ambari.js
index b6bff5c..f837ef5 100644
--- a/ambari-web/vendor/scripts/theme/bootstrap-ambari.js
+++ b/ambari-web/vendor/scripts/theme/bootstrap-ambari.js
@@ -34,6 +34,32 @@
 
       if (settings.fitHeight) {
         $(this).addClass('navigation-bar-fit-height');
+
+        // make scrolling effect on side nav ONLY, i.e. not effected on ambari main contents
+        $(this).find('.side-nav-menu').on('DOMMouseScroll mousewheel', function(ev) {
+          var $this = $(this),
+            scrollTop = (this).scrollTop,
+            scrollHeight = (this).scrollHeight,
+            height = $this.innerHeight(),
+            delta = ev.originalEvent.wheelDelta,
+            up = delta > 0;
+          var prevent = function prevent() {
+            ev.stopPropagation();
+            ev.preventDefault();
+            ev.returnValue = false;
+            return false;
+          };
+
+          if (!up && -delta > scrollHeight - height - scrollTop) {
+            // Scrolling down, but this will take us past the bottom.
+            $this.scrollTop(scrollHeight);
+            return prevent();
+          } else if (up && delta > scrollTop) {
+            // Scrolling up, but this will take us past the top.
+            $this.scrollTop(0);
+            return prevent();
+          }
+        });
       }
 
       //set main content left margin based on the width of side-nav


Mime
View raw message