All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ui.static.recordsStructure-js.recordsStructure.js Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
$(document).ready(function () {
    adjustFieldsView();
    $(document).on("change", "input[name=fields-display-view-type]", null, adjustFieldsView);
});

function adjustFieldsView() {
    let viewType = $("input[name=fields-display-view-type]:checked").val();
    $("input[name=fields-display-view-type]").each(function () {
        let type = $(this).val();
        if (type === viewType) {
            $(this).closest("label.btn").addClass("active");
        } else {
            $(this).closest("label.btn").removeClass("active");
        }
    });
    let tree = $(".fields-tree");
    let list = $(".fields-list");
    let raw = $(".fields-raw");
    tree.hide();
    list.hide();
    raw.hide();
    switch (viewType) {
        case "tree":
            tree.show();
            break;
        case "list":
            list.show();
            break;
        case "raw":
            raw.show();
            break;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy