[Rt-commit] rt branch 5.0/search-filter-modal-height created. rt-5.0.3-362-g9263f906ea

BPS Git Server git at git.bestpractical.com
Mon Apr 3 16:02:00 UTC 2023


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/search-filter-modal-height has been created
        at  9263f906eae8dc350b6e17395bd1ec70d564d538 (commit)

- Log -----------------------------------------------------------------
commit 9263f906eae8dc350b6e17395bd1ec70d564d538
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Apr 3 21:38:26 2023 +0800

    Calculate search filter modal content's max-height accurately
    
    Previously we only set the whole modal's max-height to 80%, but since
    its descendant div.modal-content's max-height was set based on
    viewport("calc(100vh - 3.5rem)") in bootstrap, its height could be
    bigger than its ancestor, in which case a scrollbar would show up.
    
    This commit set div.modal-content's max-height based on viewport and the
    position of the modal to make sure it's 100% viewable. With it, there is
    no need to set div.modal's max-height(80%) any more.

diff --git a/share/static/css/elevator-light/misc.css b/share/static/css/elevator-light/misc.css
index 6a047883ef..acb9656d4c 100644
--- a/share/static/css/elevator-light/misc.css
+++ b/share/static/css/elevator-light/misc.css
@@ -169,7 +169,6 @@ ul.ui-autocomplete {
     min-width: 300px;
     width: auto;
     height: auto;
-    max-height: 80%;
     background-color: inherit;
 }
 
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 5219aee782..654b5f2bef 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -925,6 +925,7 @@ jQuery(function() {
             left = jQuery('body').width() - modal.width() - 10;
         }
         modal.css('left', left);
+        modal.find('div.modal-content').css('max-height', jQuery(window).height() - jQuery(this).offset().top - 10);
         modal.modal('show');
     });
 

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list