Skip to content
Permalink
Browse files

jquery.event: Patch for #2708

  • Loading branch information
jzaefferer committed Apr 22, 2008
1 parent 6d28ebf commit 32b1cb3a5cde49b444fe4de269631942e9254b57
Showing with 12 additions and 1 deletion.
  1. +3 −0 src/event.js
  2. +9 −1 test/unit/event.js
@@ -293,6 +293,9 @@ jQuery.event = {
originalEvent.cancelBubble = true;
};

// Fix timeStamp
event.timeStamp = event.timeStamp || +new Date;

// Fix target property, if necessary
if ( !event.target )
event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
@@ -165,7 +165,7 @@ test("unbind(event)", function() {
ok( !jQuery.data(el[0], "events"), "Removed the events expando after all handlers are unbound." );

reset();
var clickCounter = mouseoverCounter = 0;
var clickCounter = (mouseoverCounter = 0);
var handler = function(event) {
if (event.type == "click")
clickCounter += 1;
@@ -304,3 +304,11 @@ test("jQuery(function($) {})", function() {
start();
});
});

test("event properties", function() {
stop();
$("#simon1").click(function(event) {
ok( event.timeStamp, "assert event.timeStamp is present" );
start();
}).click();
});

0 comments on commit 32b1cb3

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