This commit is contained in:
Vanessa 2023-05-18 21:10:25 +08:00
parent 839308173a
commit ca2d08de27
3 changed files with 8 additions and 2 deletions

View file

@ -30,8 +30,11 @@ export class Asset extends Model {
this.element = options.tab.panelElement;
this.path = options.path;
this.pdfId = options.page;
this.element.addEventListener("click", () => {
this.element.addEventListener("click", (event) => {
setPanelFocus(this.element.parentElement.parentElement);
this.app.plugins.forEach(item => {
item.eventBus.emit("click-pdf", event);
});
});
if (typeof this.pdfId === "string") {
this.getPdfId(() => {

View file

@ -1502,6 +1502,9 @@ export class WYSIWYG {
let shiftStartElement: HTMLElement;
this.element.addEventListener("click", (event: MouseEvent & { target: HTMLElement }) => {
this.app.plugins.forEach(item => {
item.eventBus.emit("click-editorcontent", event);
});
hideElements(["hint", "util"], protyle);
const ctrlIsPressed = event.metaKey || event.ctrlKey;
/// #if !MOBILE

View file

@ -22,7 +22,7 @@ type TOperation =
| "removeFlashcards"
type TBazaarType = "templates" | "icons" | "widgets" | "themes" | "plugins"
type TCardType = "doc" | "notebook" | "all"
type TEventBus = "ws-main" | "click-blockicon"
type TEventBus = "ws-main" | "click-blockicon" | "click-editorcontent" | "click-pdf"
declare module "blueimp-md5"