<div id="attribute-visibility-config">
    <div id="attribute-list">
        [{if $tableHtml}]
            [{$tableHtml}]
        [{else}]
        <p class="m20 pt20 text-blue display-flex align-items-center">
            <img src="[{$dir_images}]axialis/basic/button-info.svg" class="mr5" />
            <span>[{isys type="lang" ident="LC__ATTRIBUTE_SETTINGS__EMPTY_TABLE"}]</span>
        </p>
        [{/if}]
    </div>
</div>

<script>
    (function () {
        'use strict';

        const $deleteButton = $('navbar_item_delete_multiple');

        if ($deleteButton) {
            $deleteButton.on('click', () => {
                const selection = $('attribute-list')
                    .select('input[name="id[]"]:checked')
                    .invoke('getValue')
                    .map((id) => parseInt(id));

                if (selection.length === 0) {
                    idoit.Notify.info('[{isys type="lang" ident="LC__ATTRIBUTE_SETTINGS__EMPTY_SELECTION"}]');
                    return;
                }

                get_popup('attribute_setting_delete', '', '480', '160', {params:btoa(JSON.stringify({ids: JSON.stringify(selection)}))}, null,null,null,null,null);
            });
        }
    })();
</script>

<style>
    [{include file=$cssPath}]
</style>
