From: Alexander Ebert Date: Sat, 2 Nov 2013 18:59:14 +0000 (+0100) Subject: Fixed for various issues related to mobile optimization dropdowns X-Git-Tag: 2.0.0_Beta_11~8^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f3e114a12c615224c150daac385174e86351ba80;p=GitHub%2FWoltLab%2FWCF.git Fixed for various issues related to mobile optimization dropdowns --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index efd43dbe9c..95f8f58f28 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -6090,6 +6090,7 @@ WCF.System.Mobile.UX = { this._initSearchBar(); this._initButtonGroupNavigation(); + WCF.CloseOverlayHandler.addCallback('WCF.System.Mobile.UX', $.proxy(this._closeMenus, this)); WCF.DOMNodeInsertedHandler.addCallback('WCF.System.Mobile.UX', $.proxy(this._initButtonGroupNavigation, this)); }, @@ -6133,19 +6134,18 @@ WCF.System.Mobile.UX = { */ _initButtonGroupNavigation: function() { $('.buttonGroupNavigation:not(.jsMobileButtonGroupNavigation)').each(function(index, navigation) { - var $navigation = $(navigation).addClass('jsMobileButtonGroupNavigation dropdown'); + var $navigation = $(navigation).addClass('jsMobileButtonGroupNavigation');// dropdown'); var $button = $('').prependTo($navigation); - // convert button group into a dropdown menu - var $dropdownMenu = $navigation.children('ul:eq(0)').addClass('dropdownMenu');//.removeClass('smallButtons buttonGroup'); - //var $links = $dropdownMenu.find('> li > a').removeClass('button jsTooltip').removeAttr('title'); - //$links.children('span.invisible').removeClass('invisible'); - //$links.children('span.icon').remove(); - - WCF.Dropdown.initDropdown($button, false); - - $dropdownMenu.removeClass('dropdownMenu'); + $button.click(function() { $button.next().toggleClass('open'); return false; }); }); + }, + + /** + * Closes menus. + */ + _closeMenus: function() { + $('.jsMobileButtonGroupNavigation > ul.open').removeClass('open'); } }; diff --git a/wcfsetup/install/files/style/button.less b/wcfsetup/install/files/style/button.less index 7641bf882c..ebfb277384 100644 --- a/wcfsetup/install/files/style/button.less +++ b/wcfsetup/install/files/style/button.less @@ -208,43 +208,45 @@ button.small, > ul { display: none; - } - } - - #dropdownMenuContainer > ul.buttonGroup { - display: none; - font-size: 0; - position: absolute; - z-index: 450; - - &.dropdownOpen { - display: block; - } - - > li { - display: block; - float: none; - font-size: 0 !important; - opacity: 1 !important; - overflow: hidden; + font-size: 0; + position: absolute; + right: -3px; + top: 24px; + z-index: 450; - &:not(:last-child) > a { - border-bottom-width: 0; + &.open { + display: block; } - > a { - .button; - - border-radius: 0 !important; - font-size: @wcfSmallFontSize; + &.buttonGroup > li > .button { + margin: 0; + } + + > li { + display: block; + float: none; + font-size: 0 !important; + opacity: 1 !important; overflow: hidden; - text-overflow: ellipsis; - width: 124px; - white-space: nowrap; - word-wrap: normal; - > span.invisible { - display: inline; + &:not(:last-child) > a { + border-bottom-width: 0; + } + + > a { + .button; + + border-radius: 0 !important; + font-size: @wcfSmallFontSize; + overflow: hidden; + text-overflow: ellipsis; + width: 124px; + white-space: nowrap; + word-wrap: normal; + + > span.invisible { + display: inline; + } } } }