AMBARI-20483 Incorrect position of services actions dropdown after scrolling 
down the sidebar. (ababiichuk)


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

Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 5d629dc1eb9a04c551787e9d538376ff0aa8d434
Parents: 5218664
Author: ababiichuk <[email protected]>
Authored: Thu Mar 16 19:34:51 2017 +0200
Committer: ababiichuk <[email protected]>
Committed: Thu Mar 16 19:35:10 2017 +0200

----------------------------------------------------------------------
 ambari-web/vendor/scripts/theme/bootstrap-ambari.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5d629dc1/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 1f61104..b6bff5c 100644
--- a/ambari-web/vendor/scripts/theme/bootstrap-ambari.js
+++ b/ambari-web/vendor/scripts/theme/bootstrap-ambari.js
@@ -26,6 +26,7 @@
       var firstLvlMenuItemsSelector = '.side-nav-menu>li';
       var secondLvlMenuItemsSelector = '.side-nav-menu>li>ul>li';
       var $moreActions = $(this).find('.more-actions');
+      var $dropdownMenu = $moreActions.children('.dropdown-menu');
 
       $subMenuToggler.each(function (index, toggler) {
         return $(toggler).parent().addClass('has-sub-menu');
@@ -124,7 +125,18 @@
       $moreActions.hover(function () {
         $(this).css('display', 'inline-block');
       });
-      $moreActions.children('.dropdown-menu').on('click', function () {
+      if (settings.fitHeight) {
+        $moreActions.on('click', function () {
+          // set actions submenu position
+          var $moreIcon = $(this);
+          var $header = $('.side-nav-header');
+          $dropdownMenu.css({
+            top: $moreIcon.offset().top - $header.offset().top + 20 + 'px',
+            left: $moreIcon.offset().left + 'px'
+          });
+        });
+      }
+      $dropdownMenu.on('click', function () {
         // some action was triggered, should hide this icon
         var moreIcon = $(this).parent();
         setTimeout(function(){ moreIcon.hide(); }, 1000);

Reply via email to