From 72ac57cce59b1c0a496031fec6948f01c94e6cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Wed, 28 Jul 2021 10:45:01 +0200 Subject: [PATCH] busypopup: fadeout also when showing new popup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - be sure overlay will be removed - show fadout effect also when closing old popup and showing new one Signed-off-by: Szymon Kłos Change-Id: I6565c96d664a2a289a9950cc2a6b60677872a3a9 --- loleaflet/css/jsdialogs.css | 6 +++--- loleaflet/src/control/Control.JSDialog.js | 2 ++ loleaflet/src/control/Control.UIManager.js | 14 +------------- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/loleaflet/css/jsdialogs.css b/loleaflet/css/jsdialogs.css index 0455e1f29..d9f0bb32f 100644 --- a/loleaflet/css/jsdialogs.css +++ b/loleaflet/css/jsdialogs.css @@ -955,9 +955,9 @@ input[type='checkbox']:checked.autofilter, .jsdialog input[type='checkbox']:chec /* dialog/popup fade animation */ .fadeout { - animation: fade 1s; - -webkit-animation: fade 1s; - -moz-animation: fade 1s; + animation: fade 0.7s; + -webkit-animation: fade 0.7s; + -moz-animation: fade 0.7s; } @keyframes fade { diff --git a/loleaflet/src/control/Control.JSDialog.js b/loleaflet/src/control/Control.JSDialog.js index f34e32828..bffb2b641 100644 --- a/loleaflet/src/control/Control.JSDialog.js +++ b/loleaflet/src/control/Control.JSDialog.js @@ -75,6 +75,8 @@ L.Control.JSDialog = L.Control.extend({ var container = this.dialogs[data.id].container; L.DomUtil.addClass(container, 'fadeout'); container.onanimationend = function() { that.close(data.id); }; + // be sure it will be removed + setTimeout(function() { that.close(data.id); }, 700); } return; } diff --git a/loleaflet/src/control/Control.UIManager.js b/loleaflet/src/control/Control.UIManager.js index bca687495..ce4c48fb8 100644 --- a/loleaflet/src/control/Control.UIManager.js +++ b/loleaflet/src/control/Control.UIManager.js @@ -102,18 +102,6 @@ L.Control.UIManager = L.Control.extend({ }, 700); }; - var closeBusyPopup = function() { - clearTimeout(this.busyPopupTimer); - var json = { - id: 'busypopup', - jsontype: 'dialog', - type: 'modalpopup', - action: 'close' - }; - if (app.socket) - app.socket._onMessage({textMsg: 'jsdialog: ' + JSON.stringify(json)}); - }; - var fadeoutBusyPopup = function() { clearTimeout(this.busyPopupTimer); var json = { @@ -127,7 +115,7 @@ L.Control.UIManager = L.Control.extend({ }; this.map.on('showbusy', function(e) { - closeBusyPopup(); + fadeoutBusyPopup(); openBusyPopup(e.label); });