Disable auto-open of message tabs for small devices
authorAlexander Ebert <ebert@woltlab.com>
Wed, 14 Sep 2016 09:04:00 +0000 (11:04 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 14 Sep 2016 09:27:37 +0000 (11:27 +0200)
wcfsetup/install/files/js/WCF.Message.js

index 4a041c2cb75384dd45cf4c885a1ca266eeaa28ec..1c3e1683e2198bb56c2e3788f31475ff7f2e21db 100644 (file)
@@ -2230,7 +2230,7 @@ $.widget('wcf.messageTabMenu', {
                        }
                }
                
-               if ($preselect === true && this._tabs.length) {
+               if ($preselect === true && this._tabs.length && !window.matchMedia('(max-width: 544px)').matches) {
                        // pick the first available tab
                        this._tabs[0].tab.children('a').trigger('click');
                }
@@ -2259,7 +2259,7 @@ $.widget('wcf.messageTabMenu', {
         */
        _showTab: function(event, index, forceOpen) {
                var $index = (event === null) ? index : $(event.currentTarget).data('index');
-               forceOpen = (!this.options.collapsible || forceOpen === true) ? true : false;
+               forceOpen = (!this.options.collapsible || forceOpen === true);
                
                var $target = null;
                for (var $i = 0; $i < this._tabs.length; $i++) {