add ability to save widget back to catalog
This commit is contained in:
parent
24012bd526
commit
73bd316732
2 changed files with 14 additions and 4 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue