fixed issue with ie .data() method failing tests

This commit is contained in:
Misko Hevery 2010-10-22 14:26:18 -07:00
parent b41bc98c54
commit a6cfa43c19

View file

@ -189,10 +189,10 @@ function browserTrigger(element, type) {
} }
if (msie) { if (msie) {
switch(element.type) { switch(element.type) {
case 'radio': case 'radio':
case 'checkbox': case 'checkbox':
element.checked = !element.checked; element.checked = !element.checked;
break; break;
} }
element.fireEvent('on' + type); element.fireEvent('on' + type);
} else { } else {
@ -211,8 +211,14 @@ function browserTrigger(element, type) {
* *
* To work around this we instead use our own handler that fires a real event. * To work around this we instead use our own handler that fires a real event.
*/ */
_jQuery.fn.trigger = function(type) { (function(fn){
return this.each(function(index, node) { var parentTrigger = fn.trigger;
browserTrigger(node, type); fn.trigger = function(type) {
}); if (/(click|change)/.test(type)) {
}; return this.each(function(index, node) {
browserTrigger(node, type);
});
}
return parentTrigger.apply(this, arguments);
};
})(_jQuery.fn);