| Server IP : 37.9.174.138 / Your IP : 216.73.216.117 Web Server : Apache System : Linux vps6.backend.sk 6.12.100+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.100-1 (2026-07-30) x86_64 User : ftpuser ( 1001) PHP Version : 8.4.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/backend-accounting.sk/app/modules/extendedDatatable/includes/ |
Upload File : |
<link href="/modules/extendedDatatable/datatables-extended/css/style.css" rel="stylesheet" type="text/css" />
<script>
(function ($) {
'use strict';
var MIN_FILTER_SELECT_WIDTH = 120;
var MAX_FILTER_SELECT_WIDTH = 360;
function measureFilterSelectWidth($select) {
var $cell = $select.closest('td, th');
var cellWidth = $cell.length ? $cell.outerWidth() : 0;
var selectWidth = $select.outerWidth() || 0;
var width = Math.max(cellWidth, selectWidth, MIN_FILTER_SELECT_WIDTH);
return Math.min(width, MAX_FILTER_SELECT_WIDTH);
}
function buildSelectpickerOptions(widthPx) {
return {
size: false,
width: widthPx + 'px',
showTick: true,
// Show the label when exactly one item is selected, count when more.
selectedTextFormat: 'count > 1',
countSelectedText: function (numSelected) {
return 'Vybrané ' + numSelected;
},
noneSelectedText: '',
template: {
caret: '<span class="bs5-filter-caret"><i class="fa-solid fa-chevron-down"></i></span>'
}
};
}
function getPicker($select) {
return $select.data('selectpicker');
}
function closeAllBootstrapSelects($except) {
$('.bootstrap-select.open').each(function () {
var $bs = $(this);
if ($except && $bs.is($except)) {
return;
}
$bs.removeClass('open')
.find('> .dropdown-toggle')
.attr('aria-expanded', 'false');
});
}
function toggleBootstrapSelect($bs) {
var willOpen = !$bs.hasClass('open');
closeAllBootstrapSelects($bs);
$bs.toggleClass('open', willOpen)
.find('> .dropdown-toggle')
.attr('aria-expanded', willOpen ? 'true' : 'false');
if (willOpen) {
var picker = $bs.find('select.selectpickerManual').data('selectpicker');
if (picker && typeof picker.setSize === 'function') {
picker.setSize();
}
}
}
function initSelectpickerFilters($root) {
if (typeof $.fn.selectpicker !== 'function') {
return;
}
($root || $('.selectpickerManual')).each(function () {
var $select = $(this);
if (!$select.length || !$select.is('select')) {
return;
}
var width = measureFilterSelectWidth($select);
var options = buildSelectpickerOptions(width);
if ($select.data('selectpicker')) {
$select.selectpicker('destroy');
}
$select.selectpicker(options);
});
}
$(document).ready(function () {
initSelectpickerFilters();
// bootstrap-select v1.12 uses BS3 data-toggle to open; BS5 ignores it, so toggle manually.
$(document).on('click.bsSelectBs5', '.bootstrap-select > .dropdown-toggle', function (e) {
e.preventDefault();
e.stopPropagation();
toggleBootstrapSelect($(this).closest('.bootstrap-select'));
});
$(document).on('click.bsSelectBs5Close', function (e) {
if (!$(e.target).closest('.bootstrap-select').length) {
closeAllBootstrapSelects();
}
});
$(document).on('keydown.bsSelectBs5Close', function (e) {
if (e.key === 'Escape') {
closeAllBootstrapSelects();
}
});
});
window.initSelectpickerFilters = initSelectpickerFilters;
})(jQuery);
</script>