This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
2012-04-09 04:43:51 +00:00
|
|
|
// JavaScript Document
|
|
|
|
|
|
|
|
// can copy code to any of ur desired javascsript
|
|
|
|
|
|
|
|
//extended jquery to search fast.
|
|
|
|
$.extend($.expr[':'], {
|
|
|
|
'containsi': function (elem, i, match, array) {
|
|
|
|
return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
|
|
|
|
}
|
|
|
|
});
|
2012-04-19 03:50:54 +00:00
|
|
|
var interval,sval;
|
2012-04-09 04:43:51 +00:00
|
|
|
$(document).ready(function(){
|
|
|
|
$("#user_filter").keyup(function(){
|
2012-04-19 03:50:54 +00:00
|
|
|
sval = $(this).val();
|
|
|
|
$(".checkbox").popover("hide");
|
|
|
|
$("div.checkblock").hide();
|
|
|
|
clearInterval(interval);
|
|
|
|
interval = setInterval(waitForSearch,1000);
|
2012-04-09 04:43:51 +00:00
|
|
|
})
|
2012-04-19 03:50:54 +00:00
|
|
|
})
|
|
|
|
var waitForSearch = function(){
|
|
|
|
if(sval){
|
|
|
|
var totalfoundbyname = $("div#users_checkbox_ary label.member-name:containsi("+sval+")").length
|
|
|
|
if(totalfoundbyname!=0){
|
|
|
|
$("div#users_checkbox_ary label.member-name:containsi("+sval+")").parent().parent().show();
|
|
|
|
}else if(totalfoundbyname==0){
|
|
|
|
$("div#users_checkbox_ary div.for_unit:containsi("+sval+")").parent().show();
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$(".checkbox").popover('hide');
|
|
|
|
$("div.checkblock").show();
|
|
|
|
}
|
|
|
|
clearInterval(interval);
|
|
|
|
}
|