aboutsummaryrefslogtreecommitdiff
path: root/html/options_main.js
diff options
context:
space:
mode:
Diffstat (limited to 'html/options_main.js')
-rw-r--r--html/options_main.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/html/options_main.js b/html/options_main.js
index c643f25..f201023 100644
--- a/html/options_main.js
+++ b/html/options_main.js
@@ -142,9 +142,11 @@
function reset_work_page_li(ul, item, settings)
{
ul.work_name_input.value = item;
- page_allow_chbx.checked = !!settings?.allow;
+ if (settings === undefined)
+ settings = {allow: false, components: undefined};
+ page_allow_chbx.checked = !!settings.allow;
- set_page_components(settings?.components);
+ set_page_components(settings.components);
}
function work_page_li_components()
@@ -240,9 +242,11 @@
function reset_work_script_li(ul, name, data)
{
ul.work_name_input.value = maybe_string(name);
- script_url_input.value = maybe_string(data?.url);
- script_sha256_input.value = maybe_string(data?.hash);
- script_contents_field.value = maybe_string(data?.text);
+ if (data === undefined)
+ data = {};
+ script_url_input.value = maybe_string(data.url);
+ script_sha256_input.value = maybe_string(data.hash);
+ script_contents_field.value = maybe_string(data.text);
}
/* Used to get edited script data for saving. */