From 0c362e6c713b29680d83f8bbdca190540cbc9424 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 14 May 2021 18:57:51 +0200 Subject: react to few bugs --- html/options_main.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'html/options_main.js') diff --git a/html/options_main.js b/html/options_main.js index f201023..fff0c82 100644 --- a/html/options_main.js +++ b/html/options_main.js @@ -141,9 +141,8 @@ /* Used to reset edited page. */ function reset_work_page_li(ul, item, settings) { - ul.work_name_input.value = item; - if (settings === undefined) - settings = {allow: false, components: undefined}; + ul.work_name_input.value = maybe_string(item); + settings = settings || {allow: false, components: undefined}; page_allow_chbx.checked = !!settings.allow; set_page_components(settings.components); @@ -196,12 +195,9 @@ /* Used to reset edited bag. */ function reset_work_bag_li(ul, item, components) { - if (item === undefined) { - item = ""; - components = []; - }; + components = components || []; - ul.work_name_input.value = item; + ul.work_name_input.value = maybe_string(item); let old_components_ul = bag_components_ul; bag_components_ul = old_components_ul.cloneNode(false); @@ -510,7 +506,7 @@ for (let [components_ul, id_creator] of uls_creators) { let li = by_id(id_creator(change.prefix, change.item)); - components_ul.remove_child(li); + components_ul.removeChild(li); } } -- cgit v1.2.3