From b6038c87b66630b341e431a4722856c9a3a282ed Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 28 Dec 2020 17:41:59 -0500 Subject: Improve document focus control (#1167) * Improve styles for #content-scroll-focus * Create new class to manage and control document focus * Use new focus class * Add a check to prevent redundant .blur calls --- ext/fg/js/float-main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ext/fg/js') diff --git a/ext/fg/js/float-main.js b/ext/fg/js/float-main.js index a8554867..aee736a2 100644 --- a/ext/fg/js/float-main.js +++ b/ext/fg/js/float-main.js @@ -17,17 +17,21 @@ /* global * Display + * DocumentFocusController * JapaneseUtil * api */ (async () => { try { + const documentFocusController = new DocumentFocusController(); + documentFocusController.prepare(); + api.forwardLogsToBackend(); await yomichan.backendReady(); const japaneseUtil = new JapaneseUtil(null); - const display = new Display('popup', japaneseUtil); + const display = new Display('popup', japaneseUtil, documentFocusController); await display.prepare(); display.initializeState(); -- cgit v1.2.3