This commit is contained in:
Vanessa 2023-05-22 22:30:01 +08:00
parent 2c7a58d3b9
commit 7d41575c2f
5 changed files with 18 additions and 7 deletions

View File

@ -140,7 +140,7 @@ export class BlockPanel {
pinElement.classList.add("block__icon--active"); pinElement.classList.add("block__icon--active");
pinElement.setAttribute("aria-label", window.siyuan.languages.unpin); pinElement.setAttribute("aria-label", window.siyuan.languages.unpin);
this.element.setAttribute("data-pin", "true"); this.element.setAttribute("data-pin", "true");
}) });
/// #endif /// #endif
this.render(); this.render();
} }

View File

@ -491,8 +491,19 @@ export const bazaar = {
}); });
return; return;
} }
bazaar._genMyHTML(bazaarType, app);
bazaar._onBazaar(response, bazaarType, ["themes", "icons"].includes(bazaarType)); bazaar._onBazaar(response, bazaarType, ["themes", "icons"].includes(bazaarType));
bazaar._genMyHTML(bazaarType, app);
if (bazaarType === "plugins") {
confirmDialog(window.siyuan.languages.confirm, window.siyuan.languages.enablePluginTip, () => {
fetchPost("/api/petal/setPetalEnabled", {
packageName: dataObj.name,
enabled: true,
}, (response) => {
loadPlugin(app, response.data);
bazaar._genMyHTML(bazaarType, app);
});
});
}
}); });
} }
event.preventDefault(); event.preventDefault();

View File

@ -4,8 +4,8 @@ import {Constants} from "../constants";
export const moveResize = (element: HTMLElement, afterCB?: (type: string) => void) => { export const moveResize = (element: HTMLElement, afterCB?: (type: string) => void) => {
element.addEventListener("mousedown", (event: MouseEvent & { target: HTMLElement }) => { element.addEventListener("mousedown", (event: MouseEvent & { target: HTMLElement }) => {
let iconsElement = hasClosestByClassName(event.target, "resize__move"); let iconsElement = hasClosestByClassName(event.target, "resize__move");
let x: number let x: number;
let y: number let y: number;
const elementRect = element.getBoundingClientRect(); const elementRect = element.getBoundingClientRect();
if (!iconsElement) { if (!iconsElement) {
x = event.clientX; x = event.clientX;
@ -124,4 +124,4 @@ export const moveResize = (element: HTMLElement, afterCB?: (type: string) => voi
} }
}; };
}); });
} };

View File

@ -90,7 +90,7 @@ export class Tag extends Model {
openGlobalSearch(app, `#${element.getAttribute("data-label")}#`, !window.siyuan.ctrlIsPressed); openGlobalSearch(app, `#${element.getAttribute("data-label")}#`, !window.siyuan.ctrlIsPressed);
}, },
rightClick: (element: HTMLElement, event: MouseEvent) => { rightClick: (element: HTMLElement, event: MouseEvent) => {
openTagMenu(element, event, element.getAttribute("data-label")) openTagMenu(element, event, element.getAttribute("data-label"));
}, },
blockExtHTML: window.siyuan.config.readonly ? undefined : '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>', blockExtHTML: window.siyuan.config.readonly ? undefined : '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>',
topExtHTML: window.siyuan.config.readonly ? undefined : '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>' topExtHTML: window.siyuan.config.readonly ? undefined : '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>'

View File

@ -3,7 +3,7 @@ import {showMessage} from "../dialog/message";
import {isMobile} from "./functions"; import {isMobile} from "./functions";
import {fetchPost} from "./fetch"; import {fetchPost} from "./fetch";
import {Dialog} from "../dialog"; import {Dialog} from "../dialog";
import {getNotebookName, getOpenNotebookCount} from "./pathName"; import {getOpenNotebookCount} from "./pathName";
import {validateName} from "../editor/rename"; import {validateName} from "../editor/rename";
import {setStorageVal} from "../protyle/util/compatibility"; import {setStorageVal} from "../protyle/util/compatibility";