aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/float.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-16 21:36:10 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-17 18:40:43 -0400
commit598cd32946c8e10e5aa3fcec26e3fc40af44bddf (patch)
treecd030ed1d5f60aaba15c3a1c2bec284154bfc038 /ext/fg/js/float.js
parent779b4af590b7a9030de9da1005bb3d8f79c3c5d0 (diff)
Update *show* APIs to unified showContent and setContent
Diffstat (limited to 'ext/fg/js/float.js')
-rw-r--r--ext/fg/js/float.js19
1 files changed, 2 insertions, 17 deletions
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 4b3cd848..089c9422 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -32,25 +32,12 @@ class DisplayFloat extends Display {
onError(error) {
if (window.yomichan_orphaned) {
- this.onOrphaned();
+ this.setContentOrphaned();
} else {
logError(error, true);
}
}
- onOrphaned() {
- const definitions = document.querySelector('#definitions');
- const errorOrphaned = document.querySelector('#error-orphaned');
-
- if (definitions !== null) {
- definitions.style.setProperty('display', 'none', 'important');
- }
-
- if (errorOrphaned !== null) {
- errorOrphaned.style.setProperty('display', 'block', 'important');
- }
- }
-
onSearchClear() {
window.parent.postMessage('popupClose', '*');
}
@@ -121,10 +108,8 @@ DisplayFloat.onKeyDownHandlers = {
};
DisplayFloat.messageHandlers = {
- termsShow: (self, {definitions, context}) => self.termsShow(definitions, context),
- kanjiShow: (self, {definitions, context}) => self.kanjiShow(definitions, context),
+ setContent: (self, {type, details}) => self.setContent(type, details),
clearAutoPlayTimer: (self) => self.clearAutoPlayTimer(),
- orphaned: (self) => self.onOrphaned(),
setCustomCss: (self, {css}) => self.setCustomCss(css),
initialize: (self, {options, popupInfo, url, childrenSupported}) => self.initialize(options, popupInfo, url, childrenSupported)
};