From: Matthias Schmidt Date: Sun, 15 May 2016 07:59:55 +0000 (+0200) Subject: Replace removed `$.browser.mobile` X-Git-Tag: 3.0.0_Beta_1~1729 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=818d71a48ac3e1a163b08b661a3d21efd84f7f13;p=GitHub%2FWoltLab%2FWCF.git Replace removed `$.browser.mobile` --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index a34d32a353..5b64b87e32 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1137,12 +1137,14 @@ WCF.Dropdown.Interactive.Instance = Class.extend({ this._pointer = $('').appendTo(this._container); - if (!$.browser.mobile && $itemContainer !== null) { - // use jQuery scrollbar on desktop, mobile browsers have a similar display built-in - $itemContainer.perfectScrollbar({ - suppressScrollX: true - }); - } + require(['Environment'], function(Environment) { + if (Environment.platform() !== 'desktop' && $itemContainer !== null) { + // use jQuery scrollbar on desktop, mobile browsers have a similar display built-in + $itemContainer.perfectScrollbar({ + suppressScrollX: true + }); + } + }); this._container.appendTo(dropdownContainer); }, @@ -1249,15 +1251,17 @@ WCF.Dropdown.Interactive.Instance = Class.extend({ * Rebuilds the desktop scrollbar. */ rebuildScrollbar: function() { - if (!$.browser.mobile) { - var $itemContainer = this._itemList.parent(); - - // do NOT use 'update', seems to be broken - $itemContainer.perfectScrollbar('destroy'); - $itemContainer.perfectScrollbar({ - suppressScrollX: true - }); - } + require(['Environment'], function(Environment) { + if (Environment.platform() !== 'desktop') { + var $itemContainer = this._itemList.parent(); + + // do NOT use 'update', seems to be broken + $itemContainer.perfectScrollbar('destroy'); + $itemContainer.perfectScrollbar({ + suppressScrollX: true + }); + } + }.bind(this)); } }); @@ -6907,7 +6911,13 @@ WCF.Popover = Class.extend({ * @param string selector */ init: function(selector) { - if ($.browser.mobile) return; + var mobile = false; + require(['Environment'], function(Environment) { + if (Environment.platform() !== 'desktop') { + mobile = true; + } + }.bind(this)); + if (mobile) return; // assign default values this._activeElementID = '';