This commit is contained in:
parent
9cbf91d393
commit
9c0af1a252
2 changed files with 11 additions and 2 deletions
|
@ -45,6 +45,9 @@ export class Files extends Model {
|
|||
break;
|
||||
case "mount":
|
||||
this.onMount(data);
|
||||
options.app.plugins.forEach((item) => {
|
||||
item.eventBus.emit("opened-notebook", data);
|
||||
});
|
||||
break;
|
||||
case "createnotebook":
|
||||
setNoteBook((notebooks) => {
|
||||
|
@ -65,6 +68,11 @@ export class Files extends Model {
|
|||
});
|
||||
break;
|
||||
case "unmount":
|
||||
this.onRemove(data);
|
||||
options.app.plugins.forEach((item) => {
|
||||
item.eventBus.emit("closed-notebook", data);
|
||||
});
|
||||
break;
|
||||
case "removeDoc":
|
||||
this.onRemove(data);
|
||||
break;
|
||||
|
@ -763,7 +771,7 @@ export class Files extends Model {
|
|||
removeElement.remove();
|
||||
const counterElement = this.closeElement.querySelector(".counter");
|
||||
counterElement.textContent = (parseInt(counterElement.textContent) - 1).toString();
|
||||
if (counterElement.textContent === "0") {
|
||||
if (counterElement.textContent === "0") {
|
||||
counterElement.classList.add("fn__none");
|
||||
}
|
||||
}
|
||||
|
|
3
app/src/types/index.d.ts
vendored
3
app/src/types/index.d.ts
vendored
|
@ -60,7 +60,8 @@ type TEventBus = "ws-main" | "sync-start" | "sync-end" | "sync-fail" |
|
|||
"open-noneditableblock" |
|
||||
"open-menu-blockref" | "open-menu-fileannotationref" | "open-menu-tag" | "open-menu-link" | "open-menu-image" |
|
||||
"open-menu-av" | "open-menu-content" | "open-menu-breadcrumbmore" | "open-menu-doctree" | "open-menu-inbox" |
|
||||
"open-siyuan-url-plugin" | "open-siyuan-url-block" |
|
||||
"open-siyuan-url-plugin" | "open-siyuan-url-block" | "opened-notebook" |
|
||||
"closed-notebook" |
|
||||
"paste" |
|
||||
"input-search" |
|
||||
"loaded-protyle" | "loaded-protyle-dynamic" | "loaded-protyle-static" |
|
||||
|
|
Loading…
Add table
Reference in a new issue