From: Tim Düsterhus Date: Wed, 13 Mar 2019 18:40:02 +0000 (+0100) Subject: Remove enquire.js usage X-Git-Tag: 5.2.0_Alpha_1~218 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=632c9d0c5d8da27a5b16dd105c7b316153945c29;p=GitHub%2FWoltLab%2FWCF.git Remove enquire.js usage see discussion in #2866 --- diff --git a/wcfsetup/install/files/js/WCF.ImageViewer.js b/wcfsetup/install/files/js/WCF.ImageViewer.js index 10ad8da41c..16b635fca6 100644 --- a/wcfsetup/install/files/js/WCF.ImageViewer.js +++ b/wcfsetup/install/files/js/WCF.ImageViewer.js @@ -923,10 +923,12 @@ $.widget('ui.wcfImageViewer', { WCF.DOMNodeInsertedHandler.execute(); - enquire.register('(max-width: 767px)', { - match: $.proxy(this._enableMobileView, this), - unmatch: $.proxy(this._disableMobileView, this) - }); + require(['Ui/Screen'], function(UiScreen) { + UiScreen.on('screen-sm-down', { + match: $.proxy(this._enableMobileView, this), + unmatch: $.proxy(this._disableMobileView, this) + }); + }.bind(this)); return true; }, diff --git a/wcfsetup/install/files/js/WCF.Location.js b/wcfsetup/install/files/js/WCF.Location.js index 82bd9a22e9..fec9bca650 100644 --- a/wcfsetup/install/files/js/WCF.Location.js +++ b/wcfsetup/install/files/js/WCF.Location.js @@ -131,10 +131,11 @@ WCF.Location.GoogleMaps.Map = Class.extend({ // fix maps in mobile sidebars by refreshing the map when displaying // the map if (this._mapContainer.parents('.sidebar').length) { - enquire.register('(max-width: 767px)', { - setup: $.proxy(this._addSidebarMapListener, this), - deferSetup: true - }); + require(['Ui/Screen'], function(UiScreen) { + UiScreen.on('screen-sm-down', { + setup: $.proxy(this._addSidebarMapListener, this) + }); + }.bind(this)); } this.refresh(); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js index c1984c3d0f..91bf65aac9 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js @@ -8,13 +8,13 @@ */ define( [ - 'enquire', 'Ajax', 'Core', 'Dictionary', + 'Ajax', 'Core', 'Dictionary', 'Environment', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Dom/Traverse', 'Dom/Util', 'Ui/Confirmation', 'Ui/Screen', 'Ui/SimpleDropdown', 'EventHandler', 'List', 'EventKey' ], function( - enquire, Ajax, Core, Dictionary, + Ajax, Core, Dictionary, Environment, Language, ObjectMap, DomChangeListener, DomTraverse, DomUtil, UiConfirmation, UiScreen, UiSimpleDropdown, EventHandler, List, EventKey