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: "widpop" }, [
|
||||||
h.div({ class: "widopt" }, [
|
h.div({ class: "widopt" }, [
|
||||||
|
h.button(
|
||||||
|
{
|
||||||
|
title: "save",
|
||||||
|
onclick() { w.saveToCatalog(null,true) }
|
||||||
|
},
|
||||||
|
[ h.i({ class:"fas fa-save" }) ]
|
||||||
|
),
|
||||||
h.button(
|
h.button(
|
||||||
{
|
{
|
||||||
title: "rename",
|
title: "rename",
|
||||||
onclick() { api.widgets.rename(w)
|
onclick() { api.widgets.rename(w) }
|
||||||
}},
|
},
|
||||||
[ h.i({ class:"fas fa-pen-to-square" }) ]
|
[ h.i({ class:"fas fa-pen-to-square" }) ]
|
||||||
),
|
),
|
||||||
h.button(
|
h.button(
|
||||||
|
|
|
||||||
|
|
@ -98,8 +98,11 @@ class Widget {
|
||||||
this.support = false;
|
this.support = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
saveToCatalog(filename) {
|
saveToCatalog(filename, overwrite) {
|
||||||
if (this.grouped) {
|
if (!filename) {
|
||||||
|
filename = this.meta.file;
|
||||||
|
}
|
||||||
|
if (this.grouped && !overwrite) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
const widget = this;
|
const widget = this;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue