From e8097599c7728bf733c3f47e80c7d0140cfe3363 Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Thu, 10 Jun 2021 19:06:43 +0530 Subject: [PATCH] #584 the select button changes when working on a path --- src/editor/Editor.js | 9 ++------- src/editor/panels/TopPanel.js | 6 +++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 39234007..5c296d13 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -346,13 +346,8 @@ class Editor extends EditorStartup { $id('path_node_panel').style.display = (editmode) ? 'block' : 'none'; if (editmode) { // Change select icon - const elements = document.getElementsByClassName("tool_button_current"); - Array.from(elements).forEach(function (element) { - element.classList.add('tool_button_current'); - element.classList.remove('tool_button'); - }); - $id('tool_select').classList.add('tool_button_current'); - $id('tool_select').classList.remove('tool_button'); + $id('tool_path').pressed = false; + $id('tool_select').pressed = true; this.multiselected = false; if (elems.length) { this.selectedElement = elems[0]; diff --git a/src/editor/panels/TopPanel.js b/src/editor/panels/TopPanel.js index c8a03715..8a220856 100644 --- a/src/editor/panels/TopPanel.js +++ b/src/editor/panels/TopPanel.js @@ -634,8 +634,8 @@ class TopPanel { * @returns {void} */ linkControlPoints() { - const linked = $id("tool_node_link").pressed; - $id("tool_node_link").pressed = !linked; + $id("tool_node_link").pressed = ($id("tool_node_link").pressed) ? false : true; + const linked = ($id("tool_node_link").pressed) ? true : false; this.path.linkControlPoints(linked); } @@ -968,7 +968,7 @@ class TopPanel {
- +