Commit graph

97 commits

Author SHA1 Message Date
John Resig 9aa0c69c43 Fixed bubbling of live events (if an inner element handles an event first - and stops progatation - then the parent event doesn't encounter the event). Thanks to Irae for the patch. Fixes bug #3980. 2009-02-09 23:29:57 +00:00
John Resig ce00f88ae2 Added a fix, suggested by Diego, for IE firing the ready event too late. Fixes bug #3988. 2009-01-28 22:38:00 +00:00
John Resig a78557472c Focused support of .live(). stopPropagation and stopImmediatePropagation are not supported - and do not do what the use would expect. 2009-01-20 17:25:37 +00:00
Ariel Flesler 735d44f6df jquery event: closes #3843. Some events' timeStamp are wrong on Firefox, we don't rely on the native value anymore. timeStamp reflects object creation, not last event triggered. 2009-01-19 22:20:25 +00:00
John Resig c2fad371f1 Made the IE frameElement check more explicit. Fixes #3880. 2009-01-17 22:04:23 +00:00
John Resig b1018cad12 Landed a fix for when a DOM element gets accidentally removed by another live event handler. Thanks to Irae for the patches. Fixed #3820. 2009-01-10 19:57:07 +00:00
John Resig ec7baf230d Didn't get specific enough with the proxy guid, fixes #3787. 2009-01-09 22:14:48 +00:00
John Resig d12e8a34e6 Made it so that you can bind a single function to multiple .live() selectors. Additionally, simplified the proxy code to provide a default proxy function.
Fixes #3787.
2009-01-09 22:10:42 +00:00
Ariel Flesler 6898cd6d2a jquery event: Fixes #3538. unbind on many events was failing. 2009-01-08 22:21:16 +00:00
John Resig 69e86d4f98 The triggered flag was being set too early, which was preventing bubbling form working when a
native event existed.
2009-01-05 20:43:24 +00:00
Ariel Flesler 42c99472cc jquery event: Removed a needless if (old code) 2009-01-05 13:31:21 +00:00
John Resig d1146aa7bf .live("div div") was failing due to the extra space in the selector (which conflicted with multiple event binding in .bind). 2009-01-04 23:58:43 +00:00
Ariel Flesler 9472728bce jquery event: event.stopImmediatePropagation() stops live handlers as well. 2009-01-04 22:32:18 +00:00
Ariel Flesler 303ad32c74 jquery event: Misc, removed a commented line from last commit. 2009-01-02 23:44:06 +00:00
Ariel Flesler b2552e6ea3 jquery event: Now using an internal argument to detect if bubbling on $.event.trigger. The other would fail when it receives an event object with target. Also, the target isn't nulled anymore.
In addition, there was a lot of code running O(n) during bubbling while not needed.
2009-01-02 23:07:16 +00:00
Ariel Flesler 989e3f61f7 jquery event: closes #3772. The extra function on $.event.trigger isn't supported anymore. 2009-01-02 22:23:52 +00:00
Ariel Flesler c7a14f1391 jquery event: event.timeStamp wasn't being created when passing just the type to the constructor.
Misc: Simplified the readyList execution code.
2008-12-31 03:36:51 +00:00
Ariel Flesler c0446c70d5 jquery event:
* event objects have isDefaultPrevented, isPropagationStopped and isImmediatePropagationStopped methods.
* Removed donative and dohandlers from $.trigger
* event.result carries the last returned data from a handler(not undefined).
* $.trigger doesn't keep bubbling if stopPropagation() is called.
* Same event object is used all along for global trigger
* Fixed the bug where target doesn't change when triggering on many elements.
* The data array on $.trigger was accumulating objects as it bubbles.
testrunner: adding more tests
2008-12-31 02:58:13 +00:00
Ariel Flesler 0a846e5be6 jquery event: removed the argument dohandlers from $.trigger. Uses another approach. 2008-12-30 23:29:14 +00:00
John Resig 4f7441910f Made sure that return false works in .live() along with the event object being passed in as the first argument. 2008-12-30 20:45:33 +00:00
Ariel Flesler 4f99e793fa jquery event: jQuery.Event can be instantiated without the 'new' keyword. 2008-12-29 21:57:29 +00:00
Ariel Flesler 4ca4ce52f7 jquery event: Closes #3662. Adds a jQuery.Event class. Makes trigger and fix simpler. Adds currentTarget attribute to event objects. Event object isn't passed as part of data. 2008-12-25 21:44:54 +00:00
John Resig 77477d5634 Disabled native event triggering (and, thus, bubbling) for global events. 2008-12-22 14:47:34 +00:00
John Resig c03a280155 Added a new liveQuery/event delegation hybrid method: .live and .die. Easily adapts event delegation to the jQuery style. $("div").live("click", fn); $("div > #foo").live("submit", fn); $("div").die("click"); 2008-12-22 04:59:34 +00:00
John Resig 25885e07b2 Added support for bubbling triggered events. 2008-12-22 01:57:06 +00:00
John Resig b850ab2b8e Added the new jQuery.support object and removed all uses of jQuery.browser from within jQuery itself (while simultaneously deprecating the use of jQuery.browser). 2008-12-21 21:22:44 +00:00
John Resig 80a6a91347 Fixed a problem with multi-namespaced events not targetting the correct functions for execution. 2008-12-19 06:49:44 +00:00
John Resig 0935f4a0b1 Removing remaining strict-mode warnings. 2008-12-19 04:36:28 +00:00
John Resig 77344f4c50 Added support for multiple-namespaced events (in bind, trigger, and unbind). 2008-12-19 04:34:12 +00:00
John Resig 4c1e12e889 Simplifying the DOM ready code, no longer attempting to handle stylesheet loading. Closes #2614. 2008-12-19 04:29:48 +00:00
John Resig ab551c2b14 Standardized the type checks across core. isFunction and isArray now use Object.prototype.toString to verify the type, .constructor use was removed in favor of typeof, typeof checks now use ===, undefined checks use === undefined. All of this is outlined in the new style guidelines: http://docs.jquery.com/JQuery_Core_Style_Guidelines#Type_Checks. Fixes bug #3618. 2008-11-17 16:32:05 +00:00
John Resig 3b1cf91fa4 Landed the patch, by Diego, that 1) Removes browser sniffing from the ready code and 2) Provides some form of fallback DOM Ready for Iframes in IE. Closes #2614. 2008-11-12 13:18:47 +00:00
Ariel Flesler ad54d14ae5 jquery event: extra for #3498. Using the new mouse(enter|leave) shortcuts in $.fn.hover. 2008-10-22 10:06:54 +00:00
Ariel Flesler 69cbcf8637 jquery event: closes #3498, adding $.fn.mouseenter & $.fn.mouseleave. 2008-10-21 01:49:11 +00:00
Ariel Flesler aa9236e5ea jquery event: closes #3355. Added stopImmediatePropagation() to events. 2008-10-18 22:46:04 +00:00
Ariel Flesler 31293063fa jquery event: closes #3127. jQuery.event.special built-in methods were optimized. The mouse(enter|leave) special case is only added for non-IE browsers.Thanks to Mike Helgeson for his help. 2008-07-28 18:31:25 +00:00
Ariel Flesler b36fe4686c jquery event: closes #3112. It wasn't possible to bind 'data' to special events. 2008-07-09 21:38:28 +00:00
Ariel Flesler 112f7b15ae jquery event: Optimization to global unbinding on window unload. Thanks Mike Helgeson. 2008-07-01 02:50:38 +00:00
Ariel Flesler cf78e396db jquery event: closes #3107. Optimization to global event triggering. Thanks Mike Helgeson. 2008-07-01 02:25:55 +00:00
Ariel Flesler 18d3e75945 jquery event: fixed a typo in a comment. 2008-06-27 14:17:28 +00:00
Ariel Flesler abb055bb49 jquery event: caching the props array and fixing the loop that goes thru it. It was accessing an invalid index. 2008-05-28 20:43:13 +00:00
Ariel Flesler 3f5ff3097c jquery: removing unnecessary trailing and leading spaces & tabs. 2008-05-13 01:45:58 +00:00
Ariel Flesler 20a7bff401 jquery event & fx: tidying some comments. 2008-05-13 01:42:35 +00:00
Ariel Flesler 99101e02f9 jquery fx & event: replaced the use of .apply(), where .call() could had been used. 2008-05-12 19:45:02 +00:00
Ariel Flesler ca73ba5668 jquery event: removing 3 unnecessary lines since the addition of $.event.proxy. 2008-05-08 16:10:47 +00:00
Brandon Aaron 4b970deacd Making sure originalTarget gets copied over from the original event object 2008-05-07 13:21:16 +00:00
Ariel Flesler 17b1e407d1 mainly made the code shorter:
- removed some needless if's
- replace multiple "var x" for one, comma separated declaration.
- added a local fn called now() for the (new Date)s
- fixed the indentation of a block, and a typo in a comment.
- used fn instead of prototype where possible
- jquery fx: exposed the speeds hash as jQuery.fx.speeds.

Also fixed (again) line endings
2008-04-29 23:34:50 +00:00
Ariel Flesler aaff17be42 jquery event: from #2249, adding $.event.proxy to link event handlers, and implementing it on $.event.add, $.fn._toggle and $.fn.one.
It also fixes a bug in $.fn.one that was unbinding ALL the existing handlers.
2008-04-29 22:06:54 +00:00
Ariel Flesler 08836acc30 jquery event: adding some whitespaces to the last change. 2008-04-29 21:37:41 +00:00
Ariel Flesler c3cbc5bf98 jquery event: jQuery.toggle can accept more than 2 functions, closes #2378 2008-04-29 21:35:35 +00:00