From 68e4498a8733e91a4bf105ef94262bd12d7d7eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Thu, 8 Jul 2021 16:15:58 +0200 Subject: [PATCH] BusyPopup: enable for mobile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pedro Pinto Silva Signed-off-by: Szymon Kłos Change-Id: If89a567bd4609ef6993b891a042a7958e4d340d3 --- loleaflet/css/mobilewizard.css | 6 +++++- loleaflet/src/control/Control.MobileWizard.js | 19 +++++++++++++++---- loleaflet/src/control/Control.UIManager.js | 15 +++------------ 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css index a548852d8..a9b0fd5c0 100644 --- a/loleaflet/css/mobilewizard.css +++ b/loleaflet/css/mobilewizard.css @@ -256,13 +256,17 @@ p.mobile-wizard.ui-combobox-text.selected { width: 100%; position: relative; bottom: 0px; - z-index: 1001; + z-index: 2001; background-color: white; box-shadow: 0px -2px 4px 1px #00000030; overflow-x: hidden; overflow-y: auto; } +#mobile-wizard.menuwizard { + z-index: 1001; +} + #mobile-wizard-content *{ font-family: var(--mobile-font); color: #212121; diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 0e41dc8ea..e7d88d683 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -121,6 +121,8 @@ L.Control.MobileWizard = L.Control.extend({ }, _hideWizard: function() { + $('.jsdialog-overlay').remove(); + // dialog if (this.map.dialog.hasDialogInMobilePanelOpened()) { this.map.dialog._onDialogClose(window.mobileDialogId, true); @@ -452,10 +454,10 @@ L.Control.MobileWizard = L.Control.extend({ if (this._currentScrollPosition) lastScrollPosition = this._currentScrollPosition; - // for menubutton we inject popup into menu structure if (isPopup) { var popupContainer = $('.mobile-popup-container:visible'); if (popupContainer.length) { + // for menubutton we inject popup into menu structure if (data.action === 'close') { this.goLevelUp(); popupContainer.empty(); @@ -465,10 +467,16 @@ L.Control.MobileWizard = L.Control.extend({ this._builder = L.control.mobileWizardBuilder({windowId: data.id, mobileWizard: this, map: this.map, cssClass: 'mobile-wizard'}); this._builder.build(popupContainer.get(0), [data]); } - } - this._inBuilding = false; - return; + this._inBuilding = false; + return; + } else if (data.action === 'close') { + this._hideWizard(); + return; + } else { + // normal popup - continue to open mobile wizard + L.DomUtil.create('div', 'mobile-wizard jsdialog-overlay', document.body); + } } this._reset(); @@ -534,6 +542,9 @@ L.Control.MobileWizard = L.Control.extend({ this._scrollToPosition(lastScrollPosition); } + if (isPopup) + $('#mobile-wizard-titlebar').hide(); + this._updateMapSize(); this._inBuilding = false; diff --git a/loleaflet/src/control/Control.UIManager.js b/loleaflet/src/control/Control.UIManager.js index 6b99dc0ee..cb1409239 100644 --- a/loleaflet/src/control/Control.UIManager.js +++ b/loleaflet/src/control/Control.UIManager.js @@ -4,7 +4,7 @@ and allows to controll them (show/hide) */ -/* global app $ setupToolbar w2ui w2utils toolbarUpMobileItems _ Hammer */ +/* global app $ setupToolbar w2ui toolbarUpMobileItems _ Hammer */ L.Control.UIManager = L.Control.extend({ mobileWizard: null, blockedUI: false, @@ -111,20 +111,11 @@ L.Control.UIManager = L.Control.extend({ }; this.map.on('showbusy', function(e) { - if (window.mode.isMobile()) { - if (w2ui['actionbar']) - w2utils.lock(w2ui['actionbar'].box, e.label, true); - } else { - closeBusyPopup(); - openBusyPopup(e.label); - } + closeBusyPopup(); + openBusyPopup(e.label); }); this.map.on('hidebusy', function() { - // If locked, unlock - if (w2ui['actionbar'] && w2ui['actionbar'].box.firstChild.className === 'w2ui-lock') { - w2utils.unlock(w2ui['actionbar'].box); - } closeBusyPopup(); }); },