mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
🎨 bazaar
This commit is contained in:
parent
abc87ba9ea
commit
f6750f2657
1 changed files with 8 additions and 1 deletions
|
|
@ -304,6 +304,8 @@ export const bazaar = {
|
||||||
navTitle = window.siyuan.languages.widget;
|
navTitle = window.siyuan.languages.widget;
|
||||||
} else if (bazaarType === "templates") {
|
} else if (bazaarType === "templates") {
|
||||||
navTitle = window.siyuan.languages.template;
|
navTitle = window.siyuan.languages.template;
|
||||||
|
} else if (bazaarType === "plugins") {
|
||||||
|
navTitle = window.siyuan.languages.plugin;
|
||||||
}
|
}
|
||||||
const dataObj1 = {
|
const dataObj1 = {
|
||||||
bazaarType,
|
bazaarType,
|
||||||
|
|
@ -390,7 +392,7 @@ export const bazaar = {
|
||||||
bazaar.element.firstElementChild.addEventListener("click", (event) => {
|
bazaar.element.firstElementChild.addEventListener("click", (event) => {
|
||||||
let target = event.target as HTMLElement;
|
let target = event.target as HTMLElement;
|
||||||
const dataElement = hasClosestByAttribute(target, "data-obj", null);
|
const dataElement = hasClosestByAttribute(target, "data-obj", null);
|
||||||
let dataObj:IObject;
|
let dataObj: IObject;
|
||||||
if (dataElement) {
|
if (dataElement) {
|
||||||
dataObj = JSON.parse(dataElement.getAttribute("data-obj"));
|
dataObj = JSON.parse(dataElement.getAttribute("data-obj"));
|
||||||
}
|
}
|
||||||
|
|
@ -525,6 +527,10 @@ export const bazaar = {
|
||||||
}, response => {
|
}, response => {
|
||||||
this._genMyHTML(bazaarType);
|
this._genMyHTML(bazaarType);
|
||||||
bazaar._onBazaar(response, bazaarType, ["themes", "icons"].includes(bazaarType));
|
bazaar._onBazaar(response, bazaarType, ["themes", "icons"].includes(bazaarType));
|
||||||
|
// TODO destroy plugin
|
||||||
|
if (bazaarType === "plugins") {
|
||||||
|
exportLayout(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
@ -577,6 +583,7 @@ export const bazaar = {
|
||||||
packageName: dataObj.name,
|
packageName: dataObj.name,
|
||||||
enabled: (target as HTMLInputElement).checked
|
enabled: (target as HTMLInputElement).checked
|
||||||
}, () => {
|
}, () => {
|
||||||
|
// TODO destroy plugin
|
||||||
exportLayout(true);
|
exportLayout(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue