summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-12-17 12:19:06 +0100
committerJan Holesovsky <kendy@collabora.com>2019-05-03 13:54:13 +0200
commit59006ad53c720bffe397f307838f649444f3a239 (patch)
tree913569a34b2dddedb7355004a1e62acde7dcd069
parent527b8bdd7c7dcfc3b6c02427c0fdca8309b97d94 (diff)
Scrollable sidebar on mobile with small screen
Change-Id: Ib1d6684aacee68a95b946a8dcc96df76f60697c5
-rw-r--r--loleaflet/src/control/Control.LokDialog.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index b43b2d773..cfdc8ff23 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -466,6 +466,14 @@ L.Control.LokDialog = L.Control.extend({
if (!top)
top = 0;
+ if (window.mode.isMobile() && this._map._permission != 'edit')
+ return;
+
+ var ratio = 1.0;
+ if (width > window.screen.width) {
+ ratio = window.screen.width / width;
+ }
+
var strId = this._toStrId(id);
if (this._currentDeck) {
@@ -489,6 +497,10 @@ L.Control.LokDialog = L.Control.extend({
// Render window.
this._sendPaintWindowRect(id);
+
+ if (ratio < 1.0) {
+ $('#sidebar-dock-wrapper').css('width', String(width * ratio) + 'px');
+ }
return;
}