From 82836b92768bc3fa329e0d5345e93e98f5047db7 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 20 Jul 2021 11:20:49 +0200 Subject: fix options_main.js bugs --- html/options_main.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/html/options_main.js b/html/options_main.js index 2eeee1b..409df80 100644 --- a/html/options_main.js +++ b/html/options_main.js @@ -632,7 +632,7 @@ function hide_import_window() /* * Reset file . Without this, a second attempt to import the same - * file would result in "change" event on happening on element. + * file would result in "change" event not happening on element. */ file_opener_form.reset(); } @@ -684,9 +684,9 @@ function initialize_import_facility() * * We don't need to worry about the state of the page (e.g. some editing being * in progress) in jump_to_item() - this function is called at the beginning, - * before callbacks are assigned to buttons, so it is safe to assume lists are - * initialized with items and page is in its virgin state with regard to - * everything else. + * together with callbacks being assigned to buttons, so it is safe to assume + * lists are initialized with items and page is in its virgin state with regard + * to everything else. */ function jump_to_item(url_with_item) { @@ -717,8 +717,6 @@ async function main() add_radio_li(prefix, item); } - jump_to_item(document.URL); - let name = TYPE_NAME[prefix]; let add_but = by_id(`add_${name}_but`); @@ -745,6 +743,8 @@ async function main() cancel_components_but.addEventListener("click", cancel_components); } + jump_to_item(document.URL); + initialize_import_facility(); storage.add_change_listener(handle_change); -- cgit v1.2.3