summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-09-08 13:52:33 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-09-08 13:52:33 +0200
commit6672b5412cb4da044bc5df845d10bc05cddf6d75 (patch)
tree88d216edd3f0700095d43cccb5f1204b7e4cba6a
parent7b5805f81e14d2f6beea72cfd7530a425a9436b4 (diff)
Split lines only in the corner when set to 0
Change-Id: I6192219cede2d0888ecd77236f72ff734d99d778
-rw-r--r--loleaflet/css/leaflet.css1
-rw-r--r--loleaflet/src/layer/vector/SplitterLine.js11
2 files changed, 10 insertions, 2 deletions
diff --git a/loleaflet/css/leaflet.css b/loleaflet/css/leaflet.css
index 67899f262..1083c5b74 100644
--- a/loleaflet/css/leaflet.css
+++ b/loleaflet/css/leaflet.css
@@ -16,7 +16,6 @@
top: 0;
}
.leaflet-container {
- overflow: hidden;
-ms-touch-action: none;
}
.leaflet-tile,
diff --git a/loleaflet/src/layer/vector/SplitterLine.js b/loleaflet/src/layer/vector/SplitterLine.js
index 344b91625..547663fe7 100644
--- a/loleaflet/src/layer/vector/SplitterLine.js
+++ b/loleaflet/src/layer/vector/SplitterLine.js
@@ -2,7 +2,7 @@
/*
* L.SplitterLine is a draggable L.Rectangle to be used as control for split-panes.
*/
-
+/* global $ */
L.SplitterLine = L.Rectangle.extend({
options: {
@@ -43,9 +43,15 @@ L.SplitterLine = L.Rectangle.extend({
var xmin = isHoriz ? splitPos.x - thickness/2 : -size.x;
var xmax = isHoriz ? splitPos.x + thickness/2 : size.x;
+ if (!this._dragStarted && splitPos.y == 0 && !isHoriz)
+ xmax = thickness/2;
+
var ymin = !isHoriz ? splitPos.y - thickness/2 : -size.y;
var ymax = !isHoriz ? splitPos.y + thickness/2 : size.y;
+ if (!this._dragStarted && splitPos.x == 0 && isHoriz)
+ ymax = thickness/2;
+
return new L.LatLngBounds(
map.unproject(new L.Point(xmin, ymin)),
map.unproject(new L.Point(xmax, ymax))
@@ -66,6 +72,7 @@ L.SplitterLine = L.Rectangle.extend({
}.bind(this));
this.addClass('leaflet-pane-splitter');
+ $('.leaflet-pane-splitter').parent().css('overflow', 'visible');
},
_onDragStart: function(evt) {
@@ -78,6 +85,8 @@ L.SplitterLine = L.Rectangle.extend({
this._dragStarted = true;
L.DomEvent.stop(evt);
+ this.setBounds(this._calculateLatLngBounds());
+
this._pathNodeCollection.forEachNode(function (nodeData) {
var node = nodeData.getNode();
L.DomEvent.on(node, 'mousemove', this._onDrag, this);