aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-01-28 14:34:09 -0500
committerjeresig <jeresig@gmail.com>2010-01-28 14:34:09 -0500
commit0252b78201f817f87d10f14c85d0f37e4c50ce22 (patch)
treeeaeed5d09d86c842de5d5641cf3a2910a824b484 /src/event.js
parent31f1e99500af6e57cfdd571272be193b4646fc09 (diff)
downloadjquery-0252b78201f817f87d10f14c85d0f37e4c50ce22.tar.gz
jquery-0252b78201f817f87d10f14c85d0f37e4c50ce22.zip
Provide a way to simulate default browser actions. Fixes #5973.
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js
index 53ef72c0c..602332fb6 100644
--- a/src/event.js
+++ b/src/event.js
@@ -333,9 +333,12 @@ jQuery.event = {
} else if ( !event.isDefaultPrevented() ) {
var target = event.target, old,
- isClick = jQuery.nodeName(target, "a") && type === "click";
+ isClick = jQuery.nodeName(target, "a") && type === "click",
+ special = jQuery.event.special[ type ] || {};
+
+ if ( (!special._default || special._default.call( elem, event ) === false) &&
+ !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
- if ( !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
try {
if ( target[ type ] ) {
// Make sure that we don't accidentally re-trigger the onFOO events