summaryrefslogtreecommitdiff
path: root/ext/fg/js/float.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-20 13:44:33 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-20 13:44:33 -0500
commit2519f99f54412933beed8b2c753c76662099f8e0 (patch)
tree4fc453e375394749ad1cd5d1e1fb72cafef84048 /ext/fg/js/float.js
parent2a95f1420f08b034ae8e12ecffed86aa6f33e53a (diff)
Update how orphan state is observed
Diffstat (limited to 'ext/fg/js/float.js')
-rw-r--r--ext/fg/js/float.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 74bc58b0..8c7de906 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -27,17 +27,24 @@ class DisplayFloat extends Display {
url: window.location.href
};
+ this._orphaned = false;
+
+ yomichan.on('orphaned', () => this.onOrphaned());
window.addEventListener('message', (e) => this.onMessage(e), false);
}
onError(error) {
- if (window.yomichan_orphaned) {
+ if (this._orphaned) {
this.setContentOrphaned();
} else {
logError(error, true);
}
}
+ onOrphaned() {
+ this._orphaned = true;
+ }
+
onSearchClear() {
window.parent.postMessage('popupClose', '*');
}