/** * This file is part of Haketilo. * * Function: Settings page logic. * * Copyright (C) 2021 Wojtek Kosior * Redistribution terms are gathered in the `copyright' file. */ /* * IMPORTS_START * IMPORT get_remote_storage * IMPORT TYPE_PREFIX * IMPORT TYPE_NAME * IMPORT list_prefixes * IMPORT nice_name * IMPORT parse_json_with_schema * IMPORT get_template * IMPORT by_id * IMPORT matchers * IMPORT get_import_frame * IMPORT init_default_policy_dialog * IMPORTS_END */ var storage; const item_li_template = get_template("item_li"); const bag_component_li_template = get_template("bag_component_li"); const chbx_component_li_template = get_template("chbx_component_li"); const radio_component_li_template = get_template("radio_component_li"); /* Make sure they are later cloned without id. */ item_li_template.removeAttribute("id"); bag_component_li_template.removeAttribute("id"); chbx_component_li_template.removeAttribute("id"); radio_component_li_template.removeAttribute("id"); function list_set_scrollbar(list_elem) { const op = ((list_elem.children.length === 1 && list_elem.children[0].classList.contains("hide")) || list_elem.children.length < 1) ? "remove" : "add"; while (!list_elem.classList.contains("table_wrapper")) list_elem = list_elem.parentElement; list_elem.classList[op]("always_scrollbar"); } function item_li_id(prefix, item) { return `li_${prefix}_${item}`; }
summaryrefslogtreecommitdiff |