Added some missing type checks.

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

View File

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