From 632c9d0c5d8da27a5b16dd105c7b316153945c29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 13 Mar 2019 19:40:02 +0100 Subject: [PATCH] Remove enquire.js usage see discussion in #2866 --- wcfsetup/install/files/js/WCF.ImageViewer.js | 10 ++++++---- wcfsetup/install/files/js/WCF.Location.js | 9 +++++---- .../install/files/js/WoltLabSuite/Core/Ui/Dialog.js | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) 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 -- 2.20.1