You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/features/searchFade/dataTables.searchFade.min.js

18 lines
1.9 KiB
JavaScript

/*!
5 years ago
Copyright 2018 SpryMedia Ltd.
This source file is free software, available under the following license:
MIT license - http://datatables.net/license/mit
This source file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
For details please refer to: http://www.datatables.net
SearchFade 0.0.1
2018 SpryMedia Ltd - datatables.net/license
*/
5 years ago
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,c){a||(a=window);c&&c.fn.dataTable||(c=require("datatables.net")(a,c).$);return b(c,a,a.document)}:b(jQuery,window,document)})(function(b,a,c,f){function e(a,d){d.empty();d.append("Search: ");b('<input type="text" class="searchFadeInput'+a.settings()[0].sTableId+'">').appendTo(d)}b.fn.dataTable.Api.register("searchFade()",
function(){return this});b.fn.dataTable.Api.register("searchFade().node()",function(){return this.settings()[0].searchFadeNode});b.fn.dataTable.SearchFade=function(a){var d=new b.fn.dataTable.Api(a),c=b('<div class="searchFade"/>');d.settings()[0].searchFadeNode=c;e(d,c);c.on("keyup redraw","input",function(){d.rows(":visible").every(function(c,a,g){a=!0;b(".searchFadeInput"+d.settings()[0].sTableId).val().length&&(a=d.row(c).data().some(function(a){return null!=a.match(new RegExp(b(".searchFadeInput"+
d.settings()[0].sTableId).val(),"i"))}));b(d.row(c).node()).toggleClass("notMatched",!a)})});d.on("draw",function(){b("input",c).trigger("redraw")});this.node=function(){return c}};b.fn.DataTable.SearchFade=b.fn.dataTable.SearchFade;b.fn.dataTable.ext.feature.push({fnInit:function(a){return(new b.fn.dataTable.SearchFade(a)).node()},cFeature:"F"});b(c).on("init.dt",function(a,c,e){"dt"===a.namespace&&b.fn.dataTable.SearchFade(c)})});