Stop click reaching anything below the buttons

This commit is contained in:
portree_kid 2020-06-03 15:22:47 +02:00
parent 0f890d1593
commit 743b5c6e8d

View File

@ -16,11 +16,18 @@ L.EditControl = L.Control.extend({
link.href = '#';
link.title = this.options.tooltip;
link.innerHTML = this.options.html;
L.DomEvent.on(link, 'click', L.DomEvent.stop)
.on(link, 'click', function () {
window.LAYER = this.options.callback.call(map.editTools);
}, this);
link.callback = this.options.callback;
link.addEventListener('mousedown',function (event) {
event.stopPropagation();
event.preventDefault();
event.stopImmediatePropagation();
window.LAYER = this.callback.call(map.editTools);
}, false);
link.addEventListener('mouseup',function (event) {
event.stopPropagation();
event.preventDefault();
event.stopImmediatePropagation();
}, false);
return container;
}
});