From 7c6d5c83db6b89042f81ad10a5c882b7c1459ea0 Mon Sep 17 00:00:00 2001 From: mntmn Date: Mon, 28 Sep 2020 00:04:18 +0200 Subject: [PATCH] space: deselect when using tools; normalize note tool behavior --- public/javascripts/spacedeck_sections.js | 13 +++++++++++++ views/partials/tool/toolbar-elements.html | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/public/javascripts/spacedeck_sections.js b/public/javascripts/spacedeck_sections.js index d587a38..f7b3a4b 100644 --- a/public/javascripts/spacedeck_sections.js +++ b/public/javascripts/spacedeck_sections.js @@ -2555,7 +2555,18 @@ var SpacedeckSections = { evt = fixup_touches(evt); }, + start_adding_note: function(evt) { + this.deselect(); + if (this.active_tool == "note") { + this.active_tool = "pointer"; + } else { + this.active_tool = "note"; + } + this.opened_dialog = "none"; + }, + start_drawing_scribble: function(evt) { + this.deselect(); if (this.active_tool == "scribble") { this.active_tool = "pointer"; } else { @@ -2565,11 +2576,13 @@ var SpacedeckSections = { }, start_drawing_arrow: function(evt) { + this.deselect(); this.active_tool = "arrow"; this.opened_dialog = "none"; }, start_drawing_line: function(evt) { + this.deselect(); this.active_tool = "line"; this.opened_dialog = "none"; }, diff --git a/views/partials/tool/toolbar-elements.html b/views/partials/tool/toolbar-elements.html index 00154b9..22047d7 100644 --- a/views/partials/tool/toolbar-elements.html +++ b/views/partials/tool/toolbar-elements.html @@ -52,7 +52,7 @@