[Rt-commit] rt branch 5.0/scrollable-page-menu-actions created. rt-5.0.3-22-gfbc70ec467

BPS Git Server git at git.bestpractical.com
Thu Jul 21 09:04:26 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/scrollable-page-menu-actions has been created
        at  fbc70ec467d054cccb3381e31d357d7c635b6a3a (commit)

- Log -----------------------------------------------------------------
commit fbc70ec467d054cccb3381e31d357d7c635b6a3a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 21 04:21:00 2022 +0800

    Make actions page menu scrollable in case it's too long to fit in screen
    
    Previously the overflowed parts weren't visible.

diff --git a/share/html/NoAuth/css/elevator-light/AfterMenus b/share/html/NoAuth/css/elevator-light/AfterMenus
index b6440ae6b3..7d8d0deeac 100644
--- a/share/html/NoAuth/css/elevator-light/AfterMenus
+++ b/share/html/NoAuth/css/elevator-light/AfterMenus
@@ -53,6 +53,12 @@ var initMenus = function() {
     var originalOffset = jQuery("#page-menu").offset().top;
     var floatMenu      = function () {
         jQuery(".page-menu").toggleClass("pinned", jQuery(document).scrollTop() > originalOffset);
+        if ( jQuery(document).scrollTop() > originalOffset ) {
+            jQuery('#li-page-actions > ul').css('max-height', jQuery(window).height() - jQuery('#page-menu').height());
+        }
+        else {
+            jQuery('#li-page-actions > ul').css('max-height', jQuery(window).height() - jQuery('#rt-header-container').height());
+        }
     };
     floatMenu();
     jQuery(window).scroll(floatMenu);
diff --git a/share/static/css/elevator-light/nav.css b/share/static/css/elevator-light/nav.css
index c44f43f886..ba73531cdb 100644
--- a/share/static/css/elevator-light/nav.css
+++ b/share/static/css/elevator-light/nav.css
@@ -419,3 +419,8 @@ body.IE11 ul.toplevel.sf-menu > li > ul > li a.sf-with-ul:after {
 .search-results-page-menu-container .sf-menu .menu-item:hover {
     text-decoration: none;
 }
+
+/* scrollable actions */
+#li-page-actions > ul {
+    overflow-y: auto;
+}
diff --git a/share/static/js/util.js b/share/static/js/util.js
index e5e93311e0..6d16f5111c 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -864,6 +864,11 @@ jQuery(function() {
             file_input.prop('checked', false);
         });
     });
+
+    // Make actions dropdown scrollable in case screen is too short
+    jQuery(window).resize(function() {
+        jQuery('#li-page-actions > ul').css('max-height', jQuery(window).height() - jQuery('#rt-header-container').height());
+    }).resize();
 });
 
 /* inline edit */

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list