summaryrefslogtreecommitdiff
path: root/ext/fg/js/float.js
diff options
context:
space:
mode:
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', '*');
}