mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 https://github.com/siyuan-note/siyuan/issues/5066 "click-editorcontent" | "click-pdf"
This commit is contained in:
parent
839308173a
commit
ca2d08de27
3 changed files with 8 additions and 2 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
2
app/src/types/index.d.ts
vendored
2
app/src/types/index.d.ts
vendored
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue