diff --git a/js/interface/dialog.js b/js/interface/dialog.js index ee3aa1fb..83fa19f2 100644 --- a/js/interface/dialog.js +++ b/js/interface/dialog.js @@ -687,6 +687,7 @@ window.ToolConfig = class ToolConfig extends Dialog { } save() { localStorage.setItem(`tool_config.${this.id}`, JSON.stringify(this.options)); + return this; } changeOptions(options) { for (let key in options) { @@ -696,6 +697,7 @@ window.ToolConfig = class ToolConfig extends Dialog { this.form.setValues(options); } this.save(); + return this; } close(button, event) { this.save(); @@ -712,6 +714,7 @@ window.ToolConfig = class ToolConfig extends Dialog { this.object.style.top = (anchor_position.top+anchor.offsetHeight) + 'px'; this.object.style.left = Math.clamp(anchor_position.left - 30, 0, window.innerWidth-this.object.clientWidth - (this.title ? 0 : 30)) + 'px'; } + return this; } build() { if (this.object) this.object.remove(); diff --git a/js/undo.js b/js/undo.js index 74fdd36c..ebf65ba9 100644 --- a/js/undo.js +++ b/js/undo.js @@ -854,7 +854,7 @@ UndoSystem.selectionSave = class { unselectAllElements(); if (this.elements) { - Outliner.selected.replace(this.elements.map(uuid => OutlinerNode.uuids[uuid])); + Outliner.selected.replace(this.elements.map(uuid => OutlinerNode.uuids[uuid]).filter(element => element instanceof OutlinerElement)); } if (this.groups) { for (let uuid of this.groups) {