summaryrefslogtreecommitdiff
path: root/htdocs/streeteditor.js
diff options
context:
space:
mode:
authorMarkus Koch <markus@notsyncing.net>2020-05-08 17:18:10 +0200
committerMarkus Koch <markus@notsyncing.net>2020-05-08 17:18:10 +0200
commitcf5dccbc3a59163feda5d094755b571f6e24e830 (patch)
tree421b267648142e21c2ad03051452b8aa1fa60df1 /htdocs/streeteditor.js
parente936b0c35b704627ec08c6205c7d7b060c866f08 (diff)
downloadlifomapserver-cf5dccbc3a59163feda5d094755b571f6e24e830.tar.gz
lifomapserver-cf5dccbc3a59163feda5d094755b571f6e24e830.tar.bz2
lifomapserver-cf5dccbc3a59163feda5d094755b571f6e24e830.zip
Fix button behavior in editor
Stop event propagation of mouse up / down events.
Diffstat (limited to 'htdocs/streeteditor.js')
-rw-r--r--htdocs/streeteditor.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/htdocs/streeteditor.js b/htdocs/streeteditor.js
index d5f29b7..8117014 100644
--- a/htdocs/streeteditor.js
+++ b/htdocs/streeteditor.js
@@ -134,6 +134,8 @@ if (editor_mode) {
}
function show_location_string(e) {
+ if (polyline)
+ polyline.editor.cancelDrawing();
prompt("Copy this string back into the Wiki and wait for the server to refresh the maps:", get_location_string());
}
@@ -155,10 +157,12 @@ if (editor_mode) {
link.href = '#';
link.title = this.options.title;
link.innerHTML = this.options.html;
+ L.DomEvent.on(link, 'mousedown', L.DomEvent.stop);
+ L.DomEvent.on(link, 'mouseup', L.DomEvent.stop);
L.DomEvent.on(link, 'click', L.DomEvent.stop)
- .on(link, 'click', function () {
- window.LAYER = this.options.callback.call(map.editTools);
- }, this);
+ .on(link, 'click', function (e) {
+ window.LAYER = this.options.callback.call(map.editTools);
+ }, this);
return container;
}
});