Skip to content

Commit

Permalink
Quick fix for IE8: clicking on the checkbox itself didn't work.
Browse files Browse the repository at this point in the history
  • Loading branch information
kanduvisla committed Nov 3, 2010
1 parent 73d5695 commit fadd339
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions assets/jquery.symphony.mtoc.js
Expand Up @@ -46,7 +46,7 @@ var Sym = {
var option = jQuery(opt);
if(option.val() === '') return;
//clone the element, in case it gets modified later with events etc
var listItem = jQuery('<li><input type="checkbox"/><label/></li>'),
var listItem = jQuery('<li><input type="checkbox" /><label/></li>'),
value = option.val(),
labeltxt = option.text(),
id = name.replace(/\[|\]/g, '')+index;
Expand All @@ -62,7 +62,7 @@ var Sym = {
});
}
//bind one click event to save memory again in case there are lots of elements
unorderedList.bind('click', function(event) {
unorderedList.bind('click', function(event) {
var clickedObject = jQuery(event.target)[0];
var j = jQuery('li', unorderedList).length;
//check for the correct clicked object
Expand All @@ -71,6 +71,13 @@ var Sym = {
jQuery(clickedObject).siblings('input').toggleState();
break;
}
// Fix bug in IE:
if (clickedObject == jQuery('input', this)[j]) {
checked = jQuery(clickedObject).is(':checked');
jQuery(clickedObject).parent().toggleClass('checked', checked);
return;
break;
}
}
var j = jQuery('h3', unorderedList).length;
//check for the correct clicked object
Expand Down

0 comments on commit fadd339

Please sign in to comment.