diff options
author | Vjacheslav Trushkin <cyberalien@gmail.com> | 2013-10-19 22:19:32 +0300 |
---|---|---|
committer | Vjacheslav Trushkin <cyberalien@gmail.com> | 2013-10-19 22:19:32 +0300 |
commit | 7b972204ae434d929f56f7aaed72bf81464551b4 (patch) | |
tree | 288945775a1ca69a2b3c68ee9c034d9617a9518d /phpBB | |
parent | e9481c41f8e518ec8a6cab655b814ae7b2dd2d7c (diff) | |
download | forums-7b972204ae434d929f56f7aaed72bf81464551b4.tar forums-7b972204ae434d929f56f7aaed72bf81464551b4.tar.gz forums-7b972204ae434d929f56f7aaed72bf81464551b4.tar.bz2 forums-7b972204ae434d929f56f7aaed72bf81464551b4.tar.xz forums-7b972204ae434d929f56f7aaed72bf81464551b4.zip |
[ticket/11552] Do not hide all links at once
Do not hide some links as long as their is enough space
to keep them out of dropdown menu
PHPBB3-11552
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 29 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/index_body.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/viewforum_body.html | 2 |
3 files changed, 28 insertions, 5 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 97f99a5e52..f5460927a5 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -438,7 +438,7 @@ function insert_single_user(formId, user) delete test; if (oldBrowser) { - // Fix .linkslist.bulletin lists + // Fix .linklist.bulletin lists $('ul.linklist.bulletin li:first-child, ul.linklist.bulletin li.rightside:last-child').addClass('no-bulletin'); // Do not run functions below for old browsers @@ -604,7 +604,10 @@ function insert_single_user(formId, user) var $this = $(this), $body = $('body'), links = $this.children().not('.skip-responsive'), - html = '<li class="responsive-menu" style="display:none;"><a href="javascript:void(0);" class="responsive-menu-link"> </a><ul class="responsive-popup" style="display:none;" /></li>'; + html = '<li class="responsive-menu" style="display:none;"><a href="javascript:void(0);" class="responsive-menu-link"> </a><ul class="responsive-popup" style="display:none;" /></li>', + // List of items that should be hidden last + filterString = '.pagination, .icon-notifications, .icon-pm, .icon-logout, .icon-login, .mark-read', + filtered = links.filter(filterString); if (links.is('.rightside')) { @@ -690,10 +693,30 @@ function insert_single_user(formId, user) menu.find('.inputbox').parents('li:first').css('white-space', 'normal'); copied = true; } + else { + menu.children().css('display', ''); + } - links.css('display', 'none'); toggle.css('display', ''); $this.addClass('responsive'); + + // Try to not hide filtered items + if (filtered.length) { + links.not(filterString).css('display', 'none'); + + maxHeight = 0; + filtered.each(function() { + if (!$(this).height()) return; + maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); + }); + + if ($this.height() <= maxHeight) { + menu.children().filter(filterString).css('display', 'none'); + return; + } + } + + links.css('display', 'none'); } toggleLink.click(function() { diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html index 153e47e4e0..2e21c5a341 100644 --- a/phpBB/styles/prosilver/template/index_body.html +++ b/phpBB/styles/prosilver/template/index_body.html @@ -15,7 +15,7 @@ <!-- ENDIF --> <li><a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li> <!-- ENDIF --> - <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m" data-ajax="mark_forums_read" data-overlay="false">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF --> + <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside mark-read"><a href="{U_MARK_FORUMS}" accesskey="m" data-ajax="mark_forums_read" data-overlay="false">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF --> </ul> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index ecd993d7fb..04dc00aae2 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -28,7 +28,7 @@ <!-- IF S_HAS_SUBFORUM --> <!-- IF not S_IS_BOT and U_MARK_FORUMS --> <ul class="linklist"> - <li class="rightside"><a href="{U_MARK_FORUMS}" data-ajax="mark_forums_read" data-overlay="false">{L_MARK_SUBFORUMS_READ}</a></li> + <li class="rightside mark-read"><a href="{U_MARK_FORUMS}" data-ajax="mark_forums_read" data-overlay="false">{L_MARK_SUBFORUMS_READ}</a></li> </ul> <!-- ENDIF --> <!-- INCLUDE forumlist_body.html --> |