$(function () { var topicselect = new SlimSelect({ select: '#topic-select', allowDeselectOption: true, closeOnSelect: false, beforeOpen: function () { $('[data-index-filter]').each(function(){ var $target=$(this); $target.data('slimselect').close(); })} }); $("#topic-select").data('slimselect', topicselect); }); $(function () { var changeselect = new SlimSelect({ select: '#changes-select', allowDeselectOption: true, closeOnSelect: false, beforeOpen: function () { $('[data-index-filter]').each(function(){ var $target=$(this); $target.data('slimselect').close(); })} }) $("#changes-select").data('slimselect', changeselect); }); $(function () { var peopleselect = new SlimSelect({ select: '#people-select', allowDeselectOption: true, closeOnSelect: false, beforeOpen: function () { $('[data-index-filter]').each(function(){ var $target=$(this); $target.data('slimselect').close(); })} }) $("#people-select").data('slimselect', peopleselect); }); $(function () { var countriesselect = new SlimSelect({ select: '#country-select', allowDeselectOption: true, closeOnSelect: false, }) $("#country-select").data('slimselect', countriesselect); }); $(function () { const picker = new Litepicker({ element: document.getElementById('litepicker'), singleMode: false, maxDate: new Date(), numberOfMonths: 2, numberOfColumns: 2, inlineMode: true, autoRefresh: true, resetButton: true, cancelButton: true, format: "DD MMMM YYYY", setup: (picker) => { picker.on('selected', (start, end) => { $('#customtime').text(start.getDate() + '/' + (start.getMonth() + 1) + '/' + start.getFullYear() + ' - ' + end.getDate() + '/' + (end.getMonth() + 1) + '/' + end.getFullYear()); let range = new Object(); range.start = start.getFullYear() + '/' + (start.getMonth() + 1) + '/' + start.getDate(); range.end = end.getFullYear() + '/' + (end.getMonth() + 1) + '/' + end.getDate(); $('#ftrindex').data('handle').searchCustomTimeFrame(range); $('.litepicker').hide(); $('.customtime-div').show(); }); } }); $('.litepicker').hide(); var d = new Date(); d.setMonth(d.getMonth() - 1); picker.gotoDate(d); var timeframeselect = new SlimSelect({ select: '#timeframe-select', onChange: (info) => { if (info.value == "CUSTOM" && $('#timeframe-select').attr('updating')===undefined) { console.log('show picker'+$('#timeframe-select').attr('updating')); picker.show(); $('#timeframe-content').hide(); $('#custom-content').show(); } }, beforeOpen: function () { $('[data-index-filter]').each(function(){ var $target=$(this); $target.data('slimselect').close(); })} }); $("#timeframe-select").data('slimselect', timeframeselect); $('.customtime-div').click(function () { $('.customtime-div').hide(); console.log('clicked the customtime div'); picker.show(); }); $('#clearCustom').click(function () { $('.litepicker').hide(); $('#custom-content').hide(); $('#timeframe-content').show(); }); $(document).click(function() { if( $('.litepicker').is(':visible')){ $('.litepicker').hide(); $('.customtime-div').show(); } }); $("#timeframe").click(function(e) { e.stopPropagation(); return false; }); function filter(active) { if (active) { var $counterbox = $('.counterbox'); $counterbox.empty(); $counterbox.append('
'); } if (!active) { } } if ($('#ftrindex').length) { var ftrindex = $('#ftrindex').data('handle'); ftrindex.attachHook('widgetbox-nav', 'filter', filter); } else { console.log('#ftrindex has no length, abort mission.') } }); /*******************************************************************/ /* ftrtch dino */ /* [type: JS] [file:widgetbox-nav] [7.157] DESIGN*/ /*******************************************************************/ /* 0.8 D>D */ /* db 195 */