diff --git a/src/kiri/core/platform.js b/src/kiri/core/platform.js index 48c90282..e349dfb2 100644 --- a/src/kiri/core/platform.js +++ b/src/kiri/core/platform.js @@ -559,11 +559,18 @@ function platformChanged() { },[ h.div({ class: "widpop" }, [ h.div({ class: "widopt" }, [ + h.button( + { + title: "save", + onclick() { w.saveToCatalog(null,true) } + }, + [ h.i({ class:"fas fa-save" }) ] + ), h.button( { title: "rename", - onclick() { api.widgets.rename(w) - }}, + onclick() { api.widgets.rename(w) } + }, [ h.i({ class:"fas fa-pen-to-square" }) ] ), h.button( diff --git a/src/kiri/core/widget.js b/src/kiri/core/widget.js index 3b225a52..24e475cb 100644 --- a/src/kiri/core/widget.js +++ b/src/kiri/core/widget.js @@ -98,8 +98,11 @@ class Widget { this.support = false; } - saveToCatalog(filename) { - if (this.grouped) { + saveToCatalog(filename, overwrite) { + if (!filename) { + filename = this.meta.file; + } + if (this.grouped && !overwrite) { return this; } const widget = this;