aboutsummaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
Diffstat (limited to 'html')
-rw-r--r--html/options_main.js14
1 files changed, 5 insertions, 9 deletions
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);
}
}