diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-12-23 14:09:41 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-01-22 20:38:21 -0500 |
commit | f725549330e851ededad3c97c4517f8a23168e4a (patch) | |
tree | 48496d6e61b3053c33bfe560c7d370af7429acac /ext/bg/js/settings | |
parent | 14e48cf85478da1d3817be244fcdf1a28835f99b (diff) |
Remove redundant window resize handler
Diffstat (limited to 'ext/bg/js/settings')
-rw-r--r-- | ext/bg/js/settings/popup-preview-frame.js | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/ext/bg/js/settings/popup-preview-frame.js b/ext/bg/js/settings/popup-preview-frame.js index 2b727cbd..54f246e3 100644 --- a/ext/bg/js/settings/popup-preview-frame.js +++ b/ext/bg/js/settings/popup-preview-frame.js @@ -35,7 +35,6 @@ class SettingsPopupPreview { async prepare() { // Setup events - window.addEventListener('resize', (e) => this.onWindowResize(e), false); window.addEventListener('message', (e) => this.onMessage(e), false); const themeDarkCheckbox = document.querySelector('#theme-dark-checkbox'); @@ -96,16 +95,6 @@ class SettingsPopupPreview { return result; } - onWindowResize() { - if (this.frontend === null) { return; } - const textSource = this.textSource; - if (textSource === null) { return; } - - const elementRect = textSource.getRect(); - const writingMode = textSource.getWritingMode(); - this.frontend.popup.showContent(elementRect, writingMode); - } - onMessage(e) { const {action, params} = e.data; const handler = SettingsPopupPreview._messageHandlers.get(action); @@ -163,6 +152,7 @@ class SettingsPopupPreview { try { await this.frontend.onSearchSource(source, 'script'); + this.frontend.setCurrentTextSource(source); } finally { source.cleanup(); } |