diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2021-03-08 21:43:08 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2021-03-18 11:42:46 +0000 |
commit | 837bc28a6e1e381a558a8fdc7e448683b87bfc1f (patch) | |
tree | 68b067b98ba3b194961b1e8e9d46c2341d039f52 | |
parent | wopi: send file name with saveas response (diff) | |
download | online-fix/michael/copy-42-again.tar.gz online-fix/michael/copy-42-again.zip |
copy/paste dialogs: stop propagation to avoid confusing the document.
fix/michael/copy-42-again
Previously a 'click' on 'start download' - also resulted in a pair
of mouse down/up events getting sent to the map, the TileLayer, and
thus the core - resetting the object selection during the download,
and causing nasty issues in the second 'Confirm copy to clipboard'
which had a different & random selection depending what was under
that popup.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I7f6510494500dd36beb232e4720a66f2d9e09f27
-rw-r--r-- | loleaflet/src/control/Control.DownloadProgress.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/loleaflet/src/control/Control.DownloadProgress.js b/loleaflet/src/control/Control.DownloadProgress.js index 7ad98d053d..e493d6f1cb 100644 --- a/loleaflet/src/control/Control.DownloadProgress.js +++ b/loleaflet/src/control/Control.DownloadProgress.js @@ -17,9 +17,20 @@ L.Control.DownloadProgress = L.Control.extend({ return this._container; }, + // we really don't want mouse and other events propagating + // to the parent map - since they affect the context. + _ignoreEvents: function(elem) { + L.DomEvent.on(elem, 'mousedown mouseup mouseover mouseout mousemove', + function(e) { + L.DomEvent.stopPropagation(e); + return false; + }, this); + }, + _initLayout: function () { this._container = L.DomUtil.create('div', 'leaflet-control-layers'); this._container.style.visibility = 'hidden'; + this._ignoreEvents(this._container); var closeButton = L.DomUtil.create('a', 'leaflet-popup-close-button', this._container); closeButton.href = '#close'; @@ -193,6 +204,7 @@ L.Control.UploadProgress = L.Control.extend({ _initLayout: function () { this._container = L.DomUtil.create('div', 'leaflet-control-layers'); this._container.style.visibility = 'hidden'; + this._ignoreEvents(this._container); var closeButton = L.DomUtil.create('a', 'leaflet-popup-close-button', this._container); closeButton.href = '#close'; @@ -296,6 +308,7 @@ L.Control.CrossProgress = L.Control.extend({ _initLayout: function () { this._container = L.DomUtil.create('div', 'leaflet-control-layers'); this._container.style.visibility = 'hidden'; + this._ignoreEvents(this._container); // close button var closeButton = L.DomUtil.create('a', 'leaflet-popup-close-button', this._container); |