diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 7bfd6d78..7196c504 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -346,20 +346,16 @@ 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; + $id('tool_select').setAttribute('src', './images/select_node.svg'); this.multiselected = false; if (elems.length) { this.selectedElement = elems[0]; } } else { setTimeout(() => { - // setIcon('#tool_select', 'select'); + $id('tool_select').setAttribute('src', './images/select.svg'); }, 1000); } } diff --git a/src/editor/components/seButton.js b/src/editor/components/seButton.js index 7715d4fe..52e18f7b 100644 --- a/src/editor/components/seButton.js +++ b/src/editor/components/seButton.js @@ -87,10 +87,10 @@ export class ToolButton extends HTMLElement { this.$img.setAttribute('src', newValue); break; case 'pressed': - if (newValue) { - this.$div.classList.add('pressed'); - } else { + if (newValue === null) { this.$div.classList.remove('pressed'); + } else { + this.$div.classList.add('pressed'); } break; case 'size': @@ -145,7 +145,7 @@ export class ToolButton extends HTMLElement { if (value) { this.setAttribute('pressed', 'true'); } else { - this.removeAttribute('pressed', ''); + this.removeAttribute('pressed'); } } /** @@ -165,7 +165,7 @@ export class ToolButton extends HTMLElement { if (value) { this.setAttribute('disabled', 'true'); } else { - this.removeAttribute('disabled', ''); + this.removeAttribute('disabled'); } } /** diff --git a/src/editor/panels/TopPanel.js b/src/editor/panels/TopPanel.js index c0a5fcb6..6e36ce6f 100644 --- a/src/editor/panels/TopPanel.js +++ b/src/editor/panels/TopPanel.js @@ -636,8 +636,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); } @@ -970,7 +970,7 @@ class TopPanel {