Changeset 5273
- Timestamp:
- 04/21/08 20:39:17 (9 months ago)
- Location:
- trunk/jquery
- Files:
-
- 2 modified
-
src/event.js (modified) (1 diff)
-
test/unit/event.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/event.js
r4649 r5273 204 204 val = jQuery.data(elem, "handle").apply( elem, data ); 205 205 206 // Handle triggering native .onfoo handlers 207 if ( !fn&& elem["on"+type] && elem["on"+type].apply( elem, data ) === false )206 // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) 207 if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) 208 208 val = false; 209 209 -
trunk/jquery/test/unit/event.js
r4601 r5273 114 114 115 115 test("click()", function() { 116 expect( 4);116 expect(5); 117 117 $('<li><a href="#">Change location</a></li>').prependTo('#firstUL').find('a').bind('click', function() { 118 118 var close = $('spanx', this); // same with $(this).find('span'); … … 132 132 $('#firstp').click(); 133 133 ok( counter == 1, "Check that click, triggers onclick event handler also" ); 134 135 var clickCounter = 0; 136 $('#simon1')[0].onclick = function(event) { 137 clickCounter++; 138 }; 139 $('#simon1').click(); 140 ok( clickCounter == 1, "Check that click, triggers onclick event handler on an a tag also" ); 134 141 }); 135 142
