From 83b0e17f3fc1b0ed9993827d2308c344392926d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Fri, 27 Oct 2006 10:49:18 +0000 Subject: [PATCH] Fix preventDefault for all browsers --- src/jquery/jquery.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 287cd6413..03db89cb1 100644 --- a/src/jquery/jquery.js +++ b/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; } -- 2.39.5