Fix note editor not being properly unregistered from notifier
This commit is contained in:
parent
2e081ce8d2
commit
59ca0731b8
1 changed files with 2 additions and 4 deletions
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
this._destroyed = false;
|
this._destroyed = false;
|
||||||
window.addEventListener("unload", this.destroy);
|
window.addEventListener("unload", () => this.destroy(), { once: true });
|
||||||
|
|
||||||
MozXULElement.insertFTLIfNeeded('toolkit/global/textActions.ftl');
|
MozXULElement.insertFTLIfNeeded('toolkit/global/textActions.ftl');
|
||||||
document.l10n.connectRoot(this);
|
document.l10n.connectRoot(this);
|
||||||
|
@ -95,7 +95,6 @@
|
||||||
if (this._destroyed) {
|
if (this._destroyed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.removeEventListener("unload", this.destroy);
|
|
||||||
this._destroyed = true;
|
this._destroyed = true;
|
||||||
|
|
||||||
Zotero.Notifier.unregisterObserver(this._notifierID);
|
Zotero.Notifier.unregisterObserver(this._notifierID);
|
||||||
|
@ -364,7 +363,7 @@
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
this._destroyed = false;
|
this._destroyed = false;
|
||||||
window.addEventListener("unload", this.destroy);
|
window.addEventListener("unload", () => this.destroy(), { once: true });
|
||||||
|
|
||||||
this.append(document.importNode(this.content, true));
|
this.append(document.importNode(this.content, true));
|
||||||
|
|
||||||
|
@ -377,7 +376,6 @@
|
||||||
if (this._destroyed) {
|
if (this._destroyed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.removeEventListener("unload", this.destroy);
|
|
||||||
this._destroyed = true;
|
this._destroyed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue