$(function () { /* * Timeframe select, hardcoded * */ var timeframeselect = new SlimSelect({ select: '#timeframe-select', beforeOpen: function () { $('[data-index-filter]').each(function () { var $target = $(this); $target.data('slimselect').close(); }) } }); //set data for timeframe $("#timeframe-select").data('slimselect', timeframeselect); /* * Loop through every item in pagebuilder settings widget and make SlimSelect * */ $.each(window.item_array, function (i, val) { val.var = new SlimSelect({ select: val.select, allowDeselectOption: true, closeOnSelect: false, beforeOpen: function () { $('[data-index-filter]').each(function () { var $target = $(this); $target.data('slimselect').close(); }) } }); //set data for slimselect $(val.select).data('slimselect', val.var); }); /* * If filtering (from ftrindex hook), show loading in result box * */ function filter(active) { if (active) { var $counterbox = $('.counterbox'); $counterbox.empty(); $counterbox.append('
'); } if (!active) { } } /* * Attach hooks to ftrindex * */ if ($('#ftrindex').length) { var ftrindex = $('#ftrindex').data('handle'); ftrindex.attachHook('wfill-dashboard-settings', 'filter', filter); } else { console.log('#ftrindex has no length, abort mission.') } }); /*******************************************************************/ /* ftrtch dino */ /* [type: JS] [file:wfill-dashboard-settings] [55.1364] DESIGN*/ /*******************************************************************/ /* 0.1 D>D */ /* db 163 */