dev: Small formatting improvements for fuzzySearch

pull/527/head
SandyDatatables 3 years ago
parent 683c6176ab
commit e8609c7464

@ -70,7 +70,7 @@
}
}
fuzzySearch = function(searchVal, data, initial) {
function fuzzySearch(searchVal, data, initial) {
// If no searchVal has been defined then return all rows.
if(searchVal === undefined || searchVal.length === 0) {
return {
@ -196,13 +196,22 @@
let api = new $.fn.dataTable.Api(settings);
var initial = api.init().fuzzySearch;
// If this is set then fuzzy searching is enabled on the table.
if (initial) {
// If this is not set then fuzzy searching is not enabled on the table so return.
if(!initial) {
return;
}
// Find the input element
let input = $('div.dataTables_filter input', api.table().container())
let fontBold = {'font-weight': '600', 'background-color': 'rgba(255,255,255,0.1)'};
let fontNormal = {'font-weight': '500', 'background-color': 'transparent',};
let fontBold = {
'font-weight': '600',
'background-color': 'rgba(255,255,255,0.1)'
};
let fontNormal = {
'font-weight': '500',
'background-color': 'transparent'
};
let toggleCSS = {
'border': 'none',
'background': 'none',
@ -379,7 +388,6 @@
// Always add this event no matter if toggling is enabled
input.on('input keydown', triggerSearchFunction);
}
})
}());
}());
Loading…
Cancel
Save