From ad897713e6acbcbd56962e8514ac866926da3cdd Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 9 Jul 2019 17:52:44 -0400 Subject: Add support for custom popup CSS --- ext/fg/js/popup.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'ext/fg/js/popup.js') 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); -- cgit v1.2.3