summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@collabora.com>2022-05-16 18:38:09 +0300
committerGökay ŞATIR <gokaysatir@gmail.com>2022-05-24 11:59:38 +0300
commit745e7976cf54b2860c4b5cad3db19bd23a8df98c (patch)
tree48b5a56791163e7c37b637f8b362e40c4e19df51
parentw2ui-scroll use var colors (diff)
downloadonline-745e7976cf54b2860c4b5cad3db19bd23a8df98c.tar.gz
online-745e7976cf54b2860c4b5cad3db19bd23a8df98c.zip
Remove unused boxzoom related parts.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com> Change-Id: I6ce90e4ec020f2c96ad72b54ea5c5d2182c91bc1 Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
-rw-r--r--browser/Makefile.am1
-rw-r--r--browser/src/map/Map.js3
-rw-r--r--browser/src/map/handler/Map.BoxZoom.js101
3 files changed, 1 insertions, 104 deletions
diff --git a/browser/Makefile.am b/browser/Makefile.am
index 5236a122c4..896ccf4237 100644
--- a/browser/Makefile.am
+++ b/browser/Makefile.am
@@ -290,7 +290,6 @@ COOL_JS_LST =\
src/map/handler/Map.DoubleClickZoom.js \
src/dom/DomEvent.Pointer.js \
src/map/handler/Map.TouchGesture.js \
- src/map/handler/Map.BoxZoom.js \
src/map/handler/Map.Keyboard.js \
src/map/handler/Map.Welcome.js \
src/map/handler/Map.Feedback.js \
diff --git a/browser/src/map/Map.js b/browser/src/map/Map.js
index 99dda1e0ca..ad5a31c95f 100644
--- a/browser/src/map/Map.js
+++ b/browser/src/map/Map.js
@@ -152,7 +152,6 @@ L.Map = L.Evented.extend({
this.addHandler('touchGesture', L.Map.TouchGesture);
} else {
this.addHandler('mouse', L.Map.Mouse);
- this.addHandler('boxZoom', L.Map.BoxZoom);
this.addHandler('scrollHandler', L.Map.Scroll);
this.addHandler('doubleClickZoom', L.Map.DoubleClickZoom);
}
@@ -1732,7 +1731,7 @@ L.Map = L.Evented.extend({
_draggableMoved: function (obj) {
obj = obj.options.draggable ? obj : this;
- return (obj.dragging && obj.dragging.moved()) || (this.boxZoom && this.boxZoom.moved());
+ return obj.dragging && obj.dragging.moved();
},
_clearHandlers: function () {
diff --git a/browser/src/map/handler/Map.BoxZoom.js b/browser/src/map/handler/Map.BoxZoom.js
deleted file mode 100644
index f439f5829b..0000000000
--- a/browser/src/map/handler/Map.BoxZoom.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- js-indent-level: 8 -*- */
-/*
- * L.Handler.ShiftDragZoom is used to add shift-drag zoom interaction to the map
- * (zoom to a selected bounding box), enabled by default.
- */
-
-L.Map.mergeOptions({
- boxZoom: true
-});
-
-L.Map.BoxZoom = L.Handler.extend({
- initialize: function (map) {
- this._map = map;
- this._container = map._container;
- this._pane = map._panes.overlayPane;
- },
-
- addHooks: function () {
- L.DomEvent.on(this._container, 'mousedown', this._onMouseDown, this);
- },
-
- removeHooks: function () {
- L.DomEvent.off(this._container, 'mousedown', this._onMouseDown, this);
- },
-
- moved: function () {
- return this._moved;
- },
-
- _onMouseDown: function (e) {
- if (this._map._docLayer._hasActiveSelection)
- return false;
- if (!e.shiftKey || ((e.which !== 1) && (e.button !== 0))) { return false; }
-
- this._moved = false;
-
- L.DomUtil.disableTextSelection();
- L.DomUtil.disableImageDrag();
-
- this._startPoint = this._map.mouseEventToContainerPoint(e);
-
- L.DomEvent.on(document, {
- contextmenu: L.DomEvent.stop,
- mousemove: this._onMouseMove,
- mouseup: this._onMouseUp,
- keydown: this._onKeyDown
- }, this);
- },
-
- _onMouseMove: function (e) {
- if (!this._moved) {
- this._moved = true;
-
- this._box = L.DomUtil.create('div', 'leaflet-zoom-box', this._container);
- L.DomUtil.addClass(this._container, 'leaflet-crosshair');
-
- this._map.fire('boxzoomstart');
- }
-
- this._point = this._map.mouseEventToContainerPoint(e);
-
- var bounds = new L.Bounds(this._point, this._startPoint),
- size = bounds.getSize();
-
- L.DomUtil.setPosition(this._box, bounds.min);
-
- this._box.style.width = size.x + 'px';
- this._box.style.height = size.y + 'px';
- },
-
- _finish: function () {
- if (this._moved) {
- L.DomUtil.remove(this._box);
- L.DomUtil.removeClass(this._container, 'leaflet-crosshair');
- }
-
- L.DomUtil.enableTextSelection();
- L.DomUtil.enableImageDrag();
-
- L.DomEvent.off(document, {
- contextmenu: L.DomEvent.stop,
- mousemove: this._onMouseMove,
- mouseup: this._onMouseUp,
- keydown: this._onKeyDown
- }, this);
- },
-
- _onMouseUp: function (e) {
- if ((e.which !== 1) && (e.button !== 0)) { return; }
-
- this._finish();
-
- if (!this._moved) { return; }
- },
-
- _onKeyDown: function (e) {
- if (e.keyCode === 27) {
- this._finish();
- }
- }
-});