aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/float.js
diff options
context:
space:
mode:
authorAlex Yatskov <FooSoft@users.noreply.github.com>2019-10-13 08:58:40 -0700
committerGitHub <noreply@github.com>2019-10-13 08:58:40 -0700
commit320af99b7676a37157e2d7207756dd502e6be608 (patch)
tree5c28a1abba2693b22b1f3f7932f69cabcbaa453c /ext/fg/js/float.js
parent537d2ef532aa7b7498de13ab039bd23f28d32714 (diff)
parent57db18c31b117591982795c930cc9f07efc28641 (diff)
Merge pull request #253 from toasted-nutbread/style-editor
Popup style preview + themes
Diffstat (limited to 'ext/fg/js/float.js')
-rw-r--r--ext/fg/js/float.js21
1 files changed, 1 insertions, 20 deletions
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 5164cd8f..4b3cd848 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -21,7 +21,6 @@ class DisplayFloat extends Display {
constructor() {
super(document.querySelector('#spinner'), document.querySelector('#definitions'));
this.autoPlayAudioTimer = null;
- this.styleNode = null;
this.optionsContext = {
depth: 0,
@@ -101,11 +100,6 @@ class DisplayFloat extends Display {
async initialize(options, popupInfo, url, childrenSupported) {
await super.initialize(options);
- const css = options.general.customPopupCss;
- if (css) {
- this.setStyle(css);
- }
-
const {id, depth, parentFrameId} = popupInfo;
this.optionsContext.depth = depth;
this.optionsContext.url = url;
@@ -114,20 +108,6 @@ class DisplayFloat extends Display {
popupNestedInitialize(id, depth, parentFrameId, url);
}
}
-
- setStyle(css) {
- const parent = document.head;
-
- if (this.styleNode === null) {
- this.styleNode = document.createElement('style');
- }
-
- this.styleNode.textContent = css;
-
- if (this.styleNode.parentNode !== parent) {
- parent.appendChild(this.styleNode);
- }
- }
}
DisplayFloat.onKeyDownHandlers = {
@@ -145,6 +125,7 @@ DisplayFloat.messageHandlers = {
kanjiShow: (self, {definitions, context}) => self.kanjiShow(definitions, context),
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)
};