BusyPopup: enable for mobile
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com> Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: If89a567bd4609ef6993b891a042a7958e4d340d3
This commit is contained in:
parent
617b1aeae5
commit
68e4498a87
3 changed files with 23 additions and 17 deletions
|
@ -256,13 +256,17 @@ p.mobile-wizard.ui-combobox-text.selected {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
z-index: 1001;
|
z-index: 2001;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
box-shadow: 0px -2px 4px 1px #00000030;
|
box-shadow: 0px -2px 4px 1px #00000030;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#mobile-wizard.menuwizard {
|
||||||
|
z-index: 1001;
|
||||||
|
}
|
||||||
|
|
||||||
#mobile-wizard-content *{
|
#mobile-wizard-content *{
|
||||||
font-family: var(--mobile-font);
|
font-family: var(--mobile-font);
|
||||||
color: #212121;
|
color: #212121;
|
||||||
|
|
|
@ -121,6 +121,8 @@ L.Control.MobileWizard = L.Control.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_hideWizard: function() {
|
_hideWizard: function() {
|
||||||
|
$('.jsdialog-overlay').remove();
|
||||||
|
|
||||||
// dialog
|
// dialog
|
||||||
if (this.map.dialog.hasDialogInMobilePanelOpened()) {
|
if (this.map.dialog.hasDialogInMobilePanelOpened()) {
|
||||||
this.map.dialog._onDialogClose(window.mobileDialogId, true);
|
this.map.dialog._onDialogClose(window.mobileDialogId, true);
|
||||||
|
@ -452,10 +454,10 @@ L.Control.MobileWizard = L.Control.extend({
|
||||||
if (this._currentScrollPosition)
|
if (this._currentScrollPosition)
|
||||||
lastScrollPosition = this._currentScrollPosition;
|
lastScrollPosition = this._currentScrollPosition;
|
||||||
|
|
||||||
// for menubutton we inject popup into menu structure
|
|
||||||
if (isPopup) {
|
if (isPopup) {
|
||||||
var popupContainer = $('.mobile-popup-container:visible');
|
var popupContainer = $('.mobile-popup-container:visible');
|
||||||
if (popupContainer.length) {
|
if (popupContainer.length) {
|
||||||
|
// for menubutton we inject popup into menu structure
|
||||||
if (data.action === 'close') {
|
if (data.action === 'close') {
|
||||||
this.goLevelUp();
|
this.goLevelUp();
|
||||||
popupContainer.empty();
|
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 = L.control.mobileWizardBuilder({windowId: data.id, mobileWizard: this, map: this.map, cssClass: 'mobile-wizard'});
|
||||||
this._builder.build(popupContainer.get(0), [data]);
|
this._builder.build(popupContainer.get(0), [data]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this._inBuilding = false;
|
this._inBuilding = false;
|
||||||
return;
|
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();
|
this._reset();
|
||||||
|
@ -534,6 +542,9 @@ L.Control.MobileWizard = L.Control.extend({
|
||||||
this._scrollToPosition(lastScrollPosition);
|
this._scrollToPosition(lastScrollPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isPopup)
|
||||||
|
$('#mobile-wizard-titlebar').hide();
|
||||||
|
|
||||||
this._updateMapSize();
|
this._updateMapSize();
|
||||||
|
|
||||||
this._inBuilding = false;
|
this._inBuilding = false;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
and allows to controll them (show/hide)
|
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({
|
L.Control.UIManager = L.Control.extend({
|
||||||
mobileWizard: null,
|
mobileWizard: null,
|
||||||
blockedUI: false,
|
blockedUI: false,
|
||||||
|
@ -111,20 +111,11 @@ L.Control.UIManager = L.Control.extend({
|
||||||
};
|
};
|
||||||
|
|
||||||
this.map.on('showbusy', function(e) {
|
this.map.on('showbusy', function(e) {
|
||||||
if (window.mode.isMobile()) {
|
closeBusyPopup();
|
||||||
if (w2ui['actionbar'])
|
openBusyPopup(e.label);
|
||||||
w2utils.lock(w2ui['actionbar'].box, e.label, true);
|
|
||||||
} else {
|
|
||||||
closeBusyPopup();
|
|
||||||
openBusyPopup(e.label);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.map.on('hidebusy', function() {
|
this.map.on('hidebusy', function() {
|
||||||
// If locked, unlock
|
|
||||||
if (w2ui['actionbar'] && w2ui['actionbar'].box.firstChild.className === 'w2ui-lock') {
|
|
||||||
w2utils.unlock(w2ui['actionbar'].box);
|
|
||||||
}
|
|
||||||
closeBusyPopup();
|
closeBusyPopup();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue