Commit Graph

422 Commits

Author SHA1 Message Date
Dave Methvin
39f9b846e7 Fix #10712. Deal with focus/blur morphing to focusin/focusout. 2011-11-08 23:08:04 -05:00
Dave Methvin
45101de696 Fix #10717, .trigger("load") on images can't bubble to window.
This means no manually triggered event named "load" can bubble, so avoid that name for delegated custom events.
2011-11-08 19:32:25 -05:00
Daniel Herman
5ba98fe324 Replace .bind with .on when building event aliases 2011-11-07 18:07:54 -05:00
Dave Methvin
13aa84580a Fix #10676. Remove wheelDelta from the event props list.
A cross-browser solution is best handled in a plugin such as jquery-mousewheel.js .
2011-11-07 11:15:18 -05:00
Dave Methvin
90c907e8b6 Fix #10701, .preventDefault if an inline handler returns false.
Baby unicorns are slapped each time you use inline handlers, so do it sparingly.
2011-11-07 11:07:36 -05:00
Dave Methvin
a7e911b7fe Since we fixed .is(POS) let's use it and save bytes.
Also, creates a single jQuery object and reuses it in the delegation-test loop to make it more performancy.
2011-11-06 20:12:00 -05:00
Dave Methvin
83c72eaa9c Remove forever-alone regexps in event.js
These should have been removed during the event refactor.
2011-11-06 14:49:31 -05:00
Dave Methvin
5c0c86378a DRY the hover pseudo-event, get the type right, allow override.
Now with working unit test for extra correctness! If external code defines a special.hover event, we won't string-hack "hover" into "mouseenter mouseleave".
2011-10-27 17:11:40 -04:00
Dave Methvin
df4a160be7 Pass correct arg list to special._default. Thanks @mikaelkaron! 2011-10-27 16:02:54 -04:00
Rick Waldron
f0cf49fee2 Cleanup spacing in events.js. Fixes #10601 2011-10-27 15:31:35 -04:00
Dave Methvin
35bc30cd87 Fix #10576. Add alias for jQuery.event.handle so voyeur code still works.
Between new 1.7 special event hooks and jQuery.event.simulate() we have a much cleaner solution than the people calling jQuery.event.handle are doing, but we shouldn't break their use of this undocumented internal interface for now.
2011-10-26 16:02:20 -04:00
Dave Methvin
fc13f5b6ce Fix #10575. Undeclared matched var hosed recursive delegate calls.
Thanks davidmurdoch for staying with this bug!
2011-10-25 13:43:27 -04:00
Dave Methvin
746074f0f7 Remove attribute match from quickIs
As @timmywil points out, attributes and properties are confused by IE6/7. This commit also reworks the unit test case to do a better job of checking className matches.
2011-10-24 18:05:53 -04:00
Dave Methvin
ee3eb6cabf Fix #10567. Make sure quickIs matches correct class name. 2011-10-24 17:26:43 -04:00
Dave Methvin
84d2307e0e Fix #10563. Ensure event.currentTarget==this if delegated.
Now, event.delegateTarget is always the element where the event was handled, regardless of whether delegated handlers are attached.
2011-10-24 11:18:20 -04:00
Dave Methvin
560c33b395 Stop global event bubbling using onlyHandlers flag. 2011-10-24 11:18:19 -04:00
Dave Methvin
4ac6f8d9d3 Make jQuery().off(event) work for delegated events.
Logic to handle detaching by event was in both .off() and jQuery.event.remove; now it's only in .off(). It's a bit of a strange case since the event object (not the jQuery set) specifies the element.
2011-10-24 11:18:18 -04:00
Dave Methvin
b208042f52 Fold dispatch function into main event dispatch. 2011-10-24 11:18:17 -04:00
Dave Methvin
470cc07167 Don't add an empty list of handlers. 2011-10-24 11:18:15 -04:00
Dave Methvin
d28ab68699 Make event.currentTarget the delegate node, always.
This lets us use currentTarget for its intended use and avoids creating a non-standard delegateTarget property.
2011-10-24 11:18:14 -04:00
Dave Methvin
9fabe2028f Don't run direct handlers if delegate did .stopPropagation(). 2011-10-24 11:18:13 -04:00
Mathias Bynens
a6bec46170 Landing pull request 554. #10531: Remove layerX and layerY Fixes #10531.
More Details:
 - https://github.com/jquery/jquery/pull/554
 - http://bugs.jquery.com/ticket/10531
2011-10-22 16:14:47 -04:00
Dave Methvin
0a3cab8d49 Fix #10489. Disconnected elements don't bubble to document. 2011-10-13 16:30:40 -04:00
Dave Methvin
6afc2c074b Fixes #10477. Get .off(type, null, fn) right. 2011-10-11 20:31:45 -04:00
Dave Methvin
511c9fe763 Fix focus/blur unit test issues. Reopens #6705.
In the event refactor, I tried to have the focus/blur events trigger the focus/blur plus focusin/focusout events but this doesn't handle various real-world cases that expect a trigger()ed jQuery handler to run and be able to pass data even if the native event shouldn't fire.

This reopens a bug that causes a double-fire of
inline event handlers.
2011-10-10 23:14:08 -04:00
Dave Methvin
307b1a3d77 Fix #10468. Remove jQuery.event.proxy and jQuery.event.guid.
These were deprecated several versions ago and have always been undocumented. Use jQuery.proxy() and jQuery.guid instead.
2011-10-10 21:51:15 -04:00
timmywil
e828d18caa Minor fix in events; undeclared var from last commit 2011-10-07 11:45:42 -04:00
Rick Waldron
3999d39b84 Additional nits 2011-10-06 16:36:15 -04:00
Rick Waldron
4fd70e7e02 Style sweep 2011-10-06 10:21:23 -04:00
Dave Methvin
e5b16e3356 Rename jQuery.event.propHooks to .fixHooks.
We already have jQuery.propHooks for the .prop() method, so using the same name for unrelated functionality on a sub-namespace is crazy talk. Since the method involved is jQuery.event.fix(), this will hopefully tie them together. Oh, and it's shorter.
2011-10-05 21:41:32 -04:00
Dave Methvin
96a44a86d8 Fix #10375. Don't put type in jQuery.event.props
It's already set in jQuery.Event, and copying it can clobber values set by the caller, e.g., the UI widget factory.
2011-09-29 10:34:55 -04:00
Dave Methvin
9c4aaeb0a8 Expose jQuery.event.simulate for use by special event handlers. 2011-09-28 12:05:12 -04:00
Dave Methvin
c7838c3607 Minor cleanups to code. Futile effort to get IE to pass the unit test. 2011-09-25 22:04:52 -04:00
Dave Methvin
b4120a7430 propHooks now an object with props array and filter function.
Use the originalEvent to grab properties in filter functions since they often won't have been copied to event. Mark a few current props in the main jQuery.event.props list as deprecated, they aren't supported across all browsers.
2011-09-25 19:56:34 -04:00
Dave Methvin
ae27424b30 Merge branch '8789-fun-with-fix' of https://github.com/rwldrn/jquery into fix-8789-rwldrn-fix
Conflicts:
	src/event.js
	test/unit/event.js
2011-09-24 22:37:16 -04:00
Rick Waldron
87e1c62d8e Moves mouse properties to mouseProps 2011-09-23 15:45:19 -04:00
Rick Waldron
c80ad2524e current state 2011-09-22 20:02:34 -04:00
Rick Waldron
c7f3b6109e Removes early return loop, must copy properties 2011-09-22 19:05:06 -04:00
Rick Waldron
14cb04dc94 Shortcircuit fix if possible 2011-09-22 11:30:03 -04:00
Rick Waldron
dc878ae33b More ref localization 2011-09-22 11:22:56 -04:00
Rick Waldron
7dab8981f8 Remove unnec. empty line 2011-09-22 11:14:45 -04:00
Rick Waldron
737820118b More reference caching 2011-09-22 11:12:42 -04:00
Rick Waldron
7babc7f203 Cache reference to propHook lookup and result 2011-09-22 11:07:16 -04:00
Rick Waldron
66202aeae5 Restore this.propHooks => jQuery.event.propHooks for better gzip compression. Thanks gnarf 2011-09-22 10:59:29 -04:00
Rick Waldron
2c903b805c Adds notes re: crash status of fix conditions 2011-09-22 10:52:29 -04:00
Rick Waldron
313bee9de4 Moves key event fixes to own even prop hook defs 2011-09-22 10:43:32 -04:00
Rick Waldron
9ef0394fbd jQuery.event.propHooks => this.propHooks where possible 2011-09-22 10:35:18 -04:00
Dave Methvin
a4cdbf09ee Fix #7061. Lazy-attach to the genuine submit event for delegation.
Avoids the problems that arise when we try to trigger submit behavior at clicky-time.
2011-09-21 21:15:00 -04:00
Dave Methvin
03d95530b5 Remove the rarely-used pseudos from quickis.html
The cutting will continue until file size is improved.
2011-09-21 09:40:57 -04:00
Dave Methvin
61511d5ab3 Allow IE .trigger()ed events through on a check/radio. 2011-09-20 23:01:07 -04:00