diff options
author | Wojtek Kosior <koszko@koszko.org> | 2021-07-20 11:20:49 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2021-07-20 11:20:49 +0200 |
commit | 82836b92768bc3fa329e0d5345e93e98f5047db7 (patch) | |
tree | d02348204662412ab9fe976b4979816831bdb3d0 | |
parent | 9e26b71e8e6d2dd1c08d29972c96d3114b1bd24a (diff) | |
download | browser-extension-82836b92768bc3fa329e0d5345e93e98f5047db7.tar.gz browser-extension-82836b92768bc3fa329e0d5345e93e98f5047db7.zip |
fix options_main.js bugs
-rw-r--r-- | html/options_main.js | 12 |
1 files 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 <input>. Without this, a second attempt to import the same - * file would result in "change" event on happening on <input> element. + * file would result in "change" event not happening on <input> 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); |