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