1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Desktop: Resolves #11687: Plugins: Allow editor plugins to support multiple windows (#12041)

This commit is contained in:
Henry Heino
2025-06-06 02:00:47 -07:00
committed by GitHub
parent 291ba88224
commit 608dbab453
46 changed files with 1022 additions and 195 deletions

View File

@@ -180,6 +180,10 @@ export default class Plugin {
this.viewControllers_[v.handle] = v;
}
public removeViewController(v: ViewController) {
delete this.viewControllers_[v.handle];
}
public hasViewController(handle: ViewHandle) {
return !!this.viewControllers_[handle];
}
@@ -229,6 +233,10 @@ export default class Plugin {
this.onUnloadListeners_.push(callback);
}
public removeOnUnloadListener(callback: OnUnloadListener) {
this.onUnloadListeners_ = this.onUnloadListeners_.filter(other => other !== callback);
}
public onUnload() {
for (const callback of this.onUnloadListeners_) {
callback();