From a1a737da9bcf7545c856a07492e5a8304a15d36f Mon Sep 17 00:00:00 2001 From: Romuald du Song Date: Thu, 15 Jul 2021 22:03:01 +0200 Subject: [PATCH] toggle tools when shape tool or zone tool is selected, remove unused mobile dialog reference --- public/javascripts/spacedeck_sections.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/public/javascripts/spacedeck_sections.js b/public/javascripts/spacedeck_sections.js index 6758a8c6..57d68006 100644 --- a/public/javascripts/spacedeck_sections.js +++ b/public/javascripts/spacedeck_sections.js @@ -592,8 +592,21 @@ var SpacedeckSections = { return; } - if (_.contains(["mobile","shapes","zones"],id)) { + if (_.contains(["shapes","zones"],id)) { this.deselect(); + if (id == "zones") { + if (this.active_tool == "zone") { + this.active_tool = "pointer"; + } else { + this.active_tool = "zone"; + } + } else if (id == "shapes") { + if (this.active_tool == "shape") { + this.active_tool = "pointer"; + } else { + this.active_tool = "shape"; + } + } } this.opened_dialog=id;