When drawing, ignore accidental clicks on mode buttons

(closes #4042)
This commit is contained in:
Bryan Housel
2017-08-07 00:23:53 -04:00
parent 8de3429f2b
commit d0fcae1b15
+5 -1
View File
@@ -35,7 +35,11 @@ export function uiModes(context) {
.attr('tabindex', -1)
.attr('class', function(mode) { return mode.id + ' add-button col4'; })
.on('click.mode-buttons', function(mode) {
if (mode.id === context.mode().id) {
// When drawing, ignore accidental clicks on mode buttons - #4042
var currMode = context.mode().id;
if (currMode.match(/^draw/) !== null) return;
if (mode.id === currMode) {
context.enter(modeBrowse(context));
} else {
context.enter(mode);