aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authorAlex Yatskov <FooSoft@users.noreply.github.com>2019-07-10 17:38:38 -0700
committerGitHub <noreply@github.com>2019-07-10 17:38:38 -0700
commit7cfcfb3bf34bb128dc4f5a47e7846fe4cc4c8c81 (patch)
tree7a16f525c2cc7a3ac2d1241544100f40091102fa /ext/fg/js/popup.js
parent8b8482d2555342ee3e28b33f018b4246348e0702 (diff)
parentad897713e6acbcbd56962e8514ac866926da3cdd (diff)
Merge pull request #166 from toasted-nutbread/custom-popup-css
Add support for custom popup CSS
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index ad81cf03..f5ccaf8b 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -29,10 +29,17 @@ class Popup {
this.injected = null;
}
- inject() {
+ inject(options) {
if (!this.injected) {
this.injected = new Promise((resolve, reject) => {
- this.container.addEventListener('load', resolve);
+ this.container.addEventListener('load', () => {
+ this.invokeApi('setOptions', {
+ general: {
+ customPopupCss: options.general.customPopupCss
+ }
+ });
+ resolve();
+ });
this.observeFullscreen();
this.onFullscreenChanged();
});
@@ -42,7 +49,7 @@ class Popup {
}
async show(elementRect, options) {
- await this.inject();
+ await this.inject(options);
const containerStyle = window.getComputedStyle(this.container);
const containerHeight = parseInt(containerStyle.height);