commit cc04ddbe4d3c18f40371448beaa31efe5f59b6f2
parent 235d7c8dae4b661134b885f1bc1eea330d3c83d1
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 15 Sep 2017 20:42:17 -0400
Fix test failure after 8215ba7a1d5c
Diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml
@@ -48,7 +48,6 @@
<constructor><![CDATA[
this.mode = this.getAttribute('mode');
- this._onInitCallbacks = [];
this._iframe = document.getAnonymousElementByAttribute(this, "anonid", "rt-view");
// Atomic units, HTML -> RTF (cleanup)
@@ -624,6 +623,9 @@
callback(this._editor);
}
else {
+ if (!this._onInitCallbacks) {
+ this._onInitCallbacks = [];
+ }
this._onInitCallbacks.push(callback);
}
]]></body>
@@ -730,8 +732,10 @@
}
let cb;
- while (cb = this._onInitCallbacks.shift()) {
- cb(this._editor);
+ if (this._onInitCallbacks) {
+ while (cb = this._onInitCallbacks.shift()) {
+ cb(this._editor);
+ }
}
}.bind(this);
}