define(["jquery", "theme_eadtraining/minicolors"], function($, minicolors) {
    return {
        minicolors: function(elementid) {
            $(`#${elementid}`).minicolors();
        },

        form_hide: function () {
            function toggle__top_scroll_fix() {
                let top_scroll_fix = $("#id_s_theme_eadtraining_top_scroll_fix").is(":checked");
                if (top_scroll_fix) {
                    $("#admin-top_scroll_background_color").show(200);
                } else {
                    $("#admin-top_scroll_background_color").hide(200);
                }
            }
            toggle__top_scroll_fix();
            $("#id_s_theme_eadtraining_top_scroll_fix").change(toggle__top_scroll_fix);

            function toggle__navbarlayout() {
                if ($("#id_s_theme_eadtraining_navbarlayout").val() == "institutional") {
                    $("#admin-brandcolor_background_menu").hide(200);
                } else {
                    $("#admin-brandcolor_background_menu").show(200);
                }
            }
            toggle__navbarlayout();
            $("#id_s_theme_eadtraining_navbarlayout").change(toggle__navbarlayout);
        }
    };
});
