Fix test failure after 8215ba7a1d

This commit is contained in:
Dan Stillman 2017-09-15 20:42:17 -04:00
parent 235d7c8dae
commit cc04ddbe4d

View file

@ -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);
}