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));
},
*/
_initButtonGroupNavigation: function() {
$('.buttonGroupNavigation:not(.jsMobileButtonGroupNavigation)').each(function(index, navigation) {
- var $navigation = $(navigation).addClass('jsMobileButtonGroupNavigation dropdown');
+ var $navigation = $(navigation).addClass('jsMobileButtonGroupNavigation');// dropdown');
var $button = $('<a class="dropdownLabel"><span class="icon icon24 icon-list" /></a>').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');
}
};
> 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;
+ }
}
}
}