Added some missing type checks.

This commit is contained in:
Thomas Tanghus 2012-12-03 23:38:48 +01:00
parent 9ddd754bce
commit daf452b4ba
1 changed files with 2 additions and 2 deletions

View File

@ -117,7 +117,7 @@
}); });
} }
element.attr('selected','selected'); element.attr('selected','selected');
if(settings.oncheck){ if(typeof settings.oncheck === 'function'){
if(settings.oncheck(value)===false){ if(settings.oncheck(value)===false){
$(this).attr('checked', false); $(this).attr('checked', false);
return; return;
@ -128,7 +128,7 @@
}else{ }else{
var index=settings.checked.indexOf(value); var index=settings.checked.indexOf(value);
element.attr('selected',null); element.attr('selected',null);
if(settings.onuncheck){ if(typeof settings.onuncheck === 'function'){
if(settings.onuncheck(value)===false){ if(settings.onuncheck(value)===false){
$(this).attr('checked',true); $(this).attr('checked',true);
return; return;