Skip to content
Permalink
Browse files

Fix preventDefault for all browsers

  • Loading branch information
jzaefferer committed Oct 27, 2006
1 parent c6860d5 commit 83b0e17f3fc1b0ed9993827d2308c344392926d4
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/jquery/jquery.js
@@ -2299,12 +2299,6 @@ jQuery.extend({
if(jQuery.browser.msie) {
// get real event from window.event
event = window.event;
event.preventDefault = function() {
this.returnValue = false;
};
event.stopPropagation = function() {
this.cancelBubble = true;
};
// fix target property
event.target = event.srcElement;
// check safari and if target is a textnode
@@ -2314,6 +2308,13 @@ jQuery.extend({
// get parentnode from textnode
event.target = event.target.parentNode;
}
// fix preventDefault and stopPropagation
event.preventDefault = function() {
this.returnValue = false;
};
event.stopPropagation = function() {
this.cancelBubble = true;
};
return event;
}

0 comments on commit 83b0e17

Please sign in to comment.
You can’t perform that action at this time.