Commit Graph

447 Commits

Author SHA1 Message Date
jeresig
cbf9d874e5 Change event did not fire in IE when an explicit .focus() was used. Fixes #6374. 2010-10-09 19:04:15 -04:00
jeresig
79305ed146 Fix the case where live change was breaking if a live click was bound ahead of time. Very similar to #6359. Fixes #6505. 2010-10-09 18:16:08 -04:00
David Petersen
60744e8abd Set event.LiveFired to undefined in specialSubmit handler so that click events bound before the submit won't prevent the submit to fire. Fixes #6359 2010-09-30 13:46:36 -04:00
Dave Reed
cb811c04b0 Using data() on JavaScript objects sets fields directly on the object. Note that events are now a property of a function (to avoid JSON serialization - and only in the case of JavaScript objects, not DOM nodes). Fixes #6807. 2010-09-29 06:46:25 -07:00
John Resig
ab77451843 Fix mis-type in commit e3c4e57897. Thanks to @jdalton for the catch. 2010-09-28 20:13:40 -07:00
John Resig
e3c4e57897 Tweak the logic for fixing event.which. Fixes #2338. 2010-09-28 09:07:57 -07:00
Dave Methvin
adff8e45e2 If an inline handler returns false, call event.preventDefault(). Fixes #6337. 2010-09-24 18:02:31 -04:00
dmethvin
69994211b0 Don't copy event.originalTarget, it's a Netscape-specific property. Fixes #2814. 2010-09-24 17:44:48 -04:00
Robert Katic
da5706c974 Added support for map of events in live, die, delegate and undelegate. Fixes #6282. 2010-09-23 12:07:42 -04:00
jeresig
a7aa86d0b1 Fix missing var. Thanks to @jeff-themovie for the catch. 2010-09-22 16:56:48 -04:00
jeresig
c8dd49f756 Unify the means of detecting a window across the library. Fixes jQuery UI bug #5438 and jQuery bugs #6575 and 6088. 2010-09-22 16:41:51 -04:00
jeresig
9dc6e0c572 Applied the RegExp issues reported by Jeff Robinson here: http://jmrware.com/articles/2010/jqueryregex/jQueryRegexes.html Additionally broke out all remaining inline RegExp. Fixes #7062. 2010-09-22 09:16:28 -04:00
jeresig
be59693037 No need to set returnValue if preventDefault exists. Thanks kangax for the catch. 2010-09-20 10:16:36 -04:00
jeresig
acb162a697 Make sure that the removeEvent and buildFragment private functions are exposed (to help with access across modules). The final API for each of these is very much in flux and will likely change before the final release. Fixes #7011. 2010-09-08 18:13:35 -04:00
jeresig
bca5765502 Make sure that jQuery works even when the individual modules are loaded separately AND jQuery.noConflict(true) is used. Fixes #7011. 2010-09-08 13:54:33 -04:00
John Resig
1533bf7c77 Expose jQuery.uuid (use with caution) and make sure the expando property is used in the events module. 2010-04-24 14:16:27 -07:00
jeresig
8effe3a7de Made it so that you no longer need to build jQuery in order to run the test suite (but you'll still need a checkout of QUnit and Sizzle, at least). 2010-03-23 12:12:16 -04:00
jeresig
f68b46d7ab Make sure that special remove and teardown events get called when .die() is used. Additionally made sure that default actions are triggered when namespaced events are used. Fixes #6202 and #6250. 2010-03-09 12:22:25 -05:00
jeresig
9584e908a2 Added in Ben Alman's proposed event.namespace property (the property holds the namespaces specified in a call to trigger). Additionally fixes namespaces with .live(). Fixes #6208 and #6209. 2010-03-02 17:34:12 -05:00
jeresig
dcf0fa5048 More changes to get jQuery in line with JSLint. 2010-03-01 21:24:49 -05:00
jeresig
a4043cdcbf Land some additional tweaks related to running through JSLint. 2010-03-01 18:19:29 -05:00
jeresig
a18f682012 Made some code tweaks related to running jQuery through JSLint (thanks to Lorin Larson for the JSLint run). 2010-03-01 12:44:56 -05:00
jeresig
36faab439a No reason to double-bind the beforeunload event. Fixes #6113. 2010-02-27 10:03:43 -05:00
jeresig
42568db4c4 Merge branch 'master' of github.com:jquery/jquery 2010-02-27 09:02:18 -05:00
jeresig
a45372a4c5 Adding in .bind(name, false), .unbind(name, false) support - an easy way to just stop bubbling and the default action on an element. Fixes #6188. 2010-02-27 09:02:13 -05:00
brandonaaron
7d5da0ee03 Make sure events exist before trying to access them in jQuery.event.handle and removed unnecessary var statement. Fixes #6163. 2010-02-27 01:31:33 -06:00
jeresig
ba7195e3f9 Make it so that you can pass in event data to .click(), et. al. Fixes #6187. 2010-02-26 20:01:19 -05:00
jeresig
7f5179b654 Make sure that unbinding on a plain javascript object works correctly. Fixes #6184. 2010-02-26 11:32:12 -05:00
jeresig
28b489bfc8 Make sure that the correct type is set for live mouseenter/mouseleave events. Fixes #6169. 2010-02-26 11:23:49 -05:00
jeresig
26b0e913dd Make sure that live events bubble unless explicitly told not to, like a normal event. Fixes #6182. 2010-02-26 09:26:14 -05:00
jeresig
da966573c3 Make sure that elements that have been removed also have their special events cleaned up. Fixes #6084. 2010-02-13 06:10:43 -05:00
jeresig
6a82f2ae63 Make sure that mousing over XUL elements results in no trigger of a mouseleave. Fixes #6013. 2010-02-13 05:45:48 -05:00
jeresig
dd5c26304a Make sure that live focus and blur events also bind to the regular events, to handle triggered events. Fixes #6055. 2010-02-13 05:37:17 -05:00
jeresig
467063a2e2 When binding a change directly to a file input just passthrough to the normal bind. A temporary fix for #5997, needs more investigation. 2010-02-13 04:40:26 -05:00
jeresig
8404ad6070 Make sure that there are some live events before continuing on. 2010-02-12 19:38:57 -05:00
jeresig
5d36fe3210 Make sure that live mouseenter/mouseleave work properly. Fixes #6077. 2010-02-11 16:50:26 -05:00
John Resig
021b809ace Make sure that the teardown is called after all the handlers of a type are removed. Fixes #6065. 2010-02-11 01:42:51 -05:00
jeresig
35c379075c Simplify the special change/submit event removal logic, per Scott's suggestion in 5267824aa3. 2010-02-10 15:56:53 -05:00
jeresig
5267824aa3 Updated formatting for the change/submit special event logic. Also switched the function declarations to statements. Thanks to Garrett for the recommendation. 2010-02-08 23:28:15 -05:00
jeresig
75bb2d6e51 Fix in logic for handling exclusive namespace testing. Fixes #6048. 2010-02-08 11:31:01 -05:00
jeresig
43b3ed086d Update special events to work with the internal event system changes. Also fixes #5967. 2010-02-05 11:02:56 -05:00
jeresig
be2407e233 Rewrote the live event handling to use the new event logic. Also added in support for live namespaced events. Fixes #5945. 2010-02-04 21:36:32 -05:00
jeresig
e7912805d6 A large refactor of the event handling logic. Data and namespace information is maintained in a separate object now, no longer on the event handler. Proxy functions are no longer needed, as a result. Additionally execution order of the handlers is maintained, fixing #4261, and the execution of handlers is maintained even while they're being removed. Live events will be refactored separately. 2010-02-04 00:20:52 -05:00
jeresig
31432e048f Add .delegate() and .undelegate(). An alternative to using .live() which goes from a single root and filters by the specified selectors. Should be used like do: .delegate(td, hover, someFn);. Fixes #6005. 2010-02-01 18:06:03 -05:00
jeresig
98c7248518 Further optimize the empty/remove/cleanData logic. 2010-01-28 15:25:52 -05:00
jeresig
0252b78201 Provide a way to simulate default browser actions. Fixes #5973. 2010-01-28 14:34:09 -05:00
jeresig
e9092e9954 Make sure namespaces is always an array, when passed to the remove special. Follow-up to eed69eccc5. 2010-01-28 14:16:52 -05:00
jeresig
eed69eccc5 Make sure that jQuery.data( elem ) always returns a data object, fixes #5971. Improve the performance of .bind() and .unbind(), fixes #5972. 2010-01-28 14:12:44 -05:00
jeresig
942f8f7f75 No reason to limit the initial change data store to just radio elements. Fixes #5851. 2010-01-27 10:06:50 -05:00
jeresig
390186b902 Make sure that special.add actually copies over event namespaces and data. Fixes #5779 and #5834. 2010-01-25 17:01:07 -05:00
jeresig
0474917c9d Make sure multiple bound events have their namespaces and data maintained. Fixes #3549. 2010-01-25 16:45:39 -05:00
jeresig
d24443fb55 Make sure that it's possible to preventDefault natively-triggered (submit, focus, blur, click) events. Fixes #5695. 2010-01-25 13:45:07 -05:00
jeresig
3e286440d5 Make sure that .die() with no args works. Fixes #5789. 2010-01-23 16:37:12 -05:00
Matt Curry
f6ec9d54d1 Select (with a selected) fired change on first focus in IE. Fixes #5869. 2010-01-23 12:52:32 -05:00
Irae Brasil
01f72026ec Added support for multiple live event handlers, live hover, and live focus/blur (mapped to focusin/focusout). Fixes #5804, #5801, #5852. 2010-01-23 11:56:24 -05:00
Irae Brasil
b9ca157998 Make sure that live handlers don't stop inline scripts from executing. Fixes #5835. 2010-01-23 11:14:29 -05:00
Irae Brasil
150e44cdda Make sure non-left-click events don't bubble. Fixes #3861. 2010-01-23 11:12:26 -05:00
jeresig
435772e29b Adding in the change recommended by Alexander Farkas to fix some bugs in the change delegation logic. Fixes #5851. 2010-01-18 17:52:36 -05:00
jeresig
257a4693f4 Fix missing var declaration for the length iterator. 2010-01-18 17:19:44 -05:00
John Resig
199a721103 Expose the proxy object on the object, for the benefit of plugin authors (Thanks to Justin Meyer for the suggestion). 2010-01-15 15:41:09 -05:00
John Resig
4397f0fd41 Removed extraneous thisObject references. Thanks to Matt Dunlap for the heads-up. 2010-01-14 01:42:08 -05:00
jeresig
1960f28c0b Make sure no exception is thrown if no event handler is found (which is the case for applets, objects, and embeds). 2010-01-13 11:24:54 -05:00
jeresig
8e53f7b5d6 Fixed typo in logic, also disabled function setters in this case to allow the functions to passthrough and bind. 2010-01-12 21:54:06 -05:00
jeresig
1d8b3a9af2 Make sure that the focusin and focusout easy-bind methods are exposed. 2010-01-12 17:03:34 -05:00
jeresig
366039a6f0 Revert "Adding in backwards-compatiblity support for jQuery().bind/unbind/trigger - and immediately deprecating it. Please explicitly use jQuery(document) in your code."
This reverts commit e9d5947b4a.
2010-01-11 13:48:40 -05:00
jeresig
5a0ac24e35 Make sure that submit event is still bound for regular form submit events. Thanks to Mark Gibson for the fix suggestion. 2010-01-11 12:26:28 -05:00
jeresig
e9d5947b4a Adding in backwards-compatiblity support for jQuery().bind/unbind/trigger - and immediately deprecating it. Please explicitly use jQuery(document) in your code. 2010-01-06 11:32:29 -05:00
jeresig
230614b4df Merging in jQuery.proxy() branch. 2010-01-05 19:18:39 -05:00
jeresig
8db0dd2c64 Added in a holdover jQuery.event.guid for back-compat (two plugins use it: mousewheel and a datepicker). Plugin authors should work to stop using jQuery.event.guid and jQuery.event.proxy ASAP. 2010-01-05 19:17:28 -05:00
jeresig
a5dbca4a06 Moved jQuery.proxy() into core. 2009-12-31 15:06:45 -05:00
jeresig
40ce7f9830 Merge branch 'bug-5735' 2009-12-31 14:49:01 -05:00
jeresig
6cb2945837 Rather than declaring empty anonymous functions all around, introduce and use a single empty function. Thanks to Matt Kruse for the suggestion. 2009-12-31 09:50:49 -05:00
jeresig
ea5d514008 When .bind('unload') was called it accidentally went recursive, from 1bac61655b. Fixes #5688. 2009-12-31 00:49:53 -05:00
jeresig
66975de2d2 Remove the .bind(name, fn, thisObject) and promote jQuery.event.proxy() to jQuery.proxy() as alternative to handling scoping on callbacks. Fixes #5736. 2009-12-31 00:37:23 -05:00
jeresig
7e69fdbad4 Fixed spelling mistake noted in dc6b7ce3469eaadb37a151d449e8d36571d1894. 2009-12-21 20:19:49 -05:00
jeresig
3776cbe314 Standardize on using double-quotes for string literals. 2009-12-21 20:13:16 -05:00
jeresig
61e37d4149 Made a number of spacing changes to bring the code more-inline with the jQuery Core Style Guideline. 2009-12-21 19:58:13 -05:00
jeresig
36c99dc0c7 Tweaked the syntax of withinElement a bit. 2009-12-21 18:06:23 -05:00
jeresig
e083d15fc7 Tweaked a couple cases where == was used instead of ===. 2009-12-21 18:02:02 -05:00
Alexander Farkas
209751fcbd Make sure that the beforeactivate event isn't accidentally prevented. 2009-12-21 16:24:03 -05:00
Jörn Zaefferer
03481a52c7 Stop trying to emulate the focus/blur event in IE, doesn't work as one might expect, anyway. Instead, implement the focusin/focusout events in all other browsers - which creates a much better parity across all browsers. Uses event capturing instead of bubbling to make it happen. Thanks to Alexander for the recommendation and to Joern Zaefferer for the original focus/blur delegation code. 2009-12-21 16:10:21 -05:00
Alexander Farkas
5dc6b7ce34 Used the patch from Alexander as the basis for a rewrite of the IE change event logic. Now has full parity with the regular change event in other browsers: Works with regular bind, works better with multiple selects, works as a regular change event (note test suite changes), works with readonly/disabled inputs, and much more. The original patch had a number of problems, including firing the change event too many times, not bubblinb properly, and not handling clicks on multi-selects properly - that should all be fixed now. Thanks Alexander for the patch pushing in the right direction. 2009-12-21 15:32:32 -05:00
jeresig
1feb92afb4 Make sure that we don't bind the onunload event in Opera. 2009-12-18 22:35:02 -05:00
jeresig
42f8c3add3 No need to use the conditional comment for binding the onunload event in IE. 2009-12-18 20:29:22 -05:00
jeresig
9997620420 Retooled the arguments.callee-related changes in 98ce35d52b to avoid re-declarations where possible. 2009-12-16 16:45:00 -05:00
jeresig
fe9333cc79 No need to use jQuery's event system for binding the onunload event in IE. 2009-12-16 15:42:03 -05:00
John Resig
253e73af51 Fixed typo from commit 542099a278. 2009-12-11 12:49:22 -08:00
Karl Swedberg
1bac61655b combined jQuery.bind() and jQuery.one() to make them more DRY 2009-12-10 14:44:30 -08:00
John Resig
f25eedf32a Restrict the attr quick setters to only methods that specifically ask for the functionality. Fixes #5612. 2009-12-09 21:28:33 -08:00
John Resig
b846ad4ca0 Add a try/catch to handle the exception thrown by unloaded iframes in IE. Fixes #4280. 2009-12-09 16:00:59 -08:00
John Resig
3ec2f1aef6 Make sure that we don't try to trigger non-existant native events on applets, embed, objects, etc. as it'll cause an exception with Java applets. Fixes #2414. 2009-12-09 14:49:31 -08:00
John Resig
1052792bb2 Fixed problems with removing live events. Fixes #4894. 2009-12-09 14:43:53 -08:00
John Resig
86bbf9cf87 We have to access the native event handlers/triggers directly, otherwise they won't execute in most modern browsers. Fixes #5124. 2009-12-09 13:53:07 -08:00
John Resig
98ce35d52b Removed uses of arguments.callee from jQuery. 2009-12-07 16:42:25 -08:00
John Resig
00a0abb751 Moved .ready() to core.js from event.js. 2009-12-07 16:34:55 -08:00
John Resig
97323d192f Oops, missed a closing } from 7d36ccfa8e. 2009-12-07 07:38:16 -08:00
John Resig
7d36ccfa8e Broke out the logic for the bubbling change/submit events so that they aren't bound if they aren't used. 2009-12-06 18:20:08 -08:00
John Resig
542099a278 Make sure that we're doing proper focus bubble testing. Also simplified the logic for the IE focusin/focusout handling. 2009-12-06 18:02:58 -08:00
John Resig
aea5b09195 Adding in cross-browser onbeforeunload support. Fixes #4106. 2009-12-06 16:55:08 -08:00
lrbabe
2d27e053a0 Fix inverted 'orig' and 'fix' event in mouseenter/mouseleave special events. 2009-12-06 09:13:57 +08:00
Karl Swedberg
3afc6533e2 added semicolons to end of 2 statements (and fixed a misspelled word in comment) 2009-12-06 08:55:54 +08:00
John Resig
8d1efee316 Retooled the native triggering code, simplifying it. 2009-12-04 23:18:05 -05:00
Justin Meyer
d42afd0f65 Adding in support for bubbling submit and change events, thanks to the patch by Justin Meyer. Includes a delegation test suite for manually testing to see if the events work as intended. 2009-12-04 11:28:50 -05:00
jeresig
c3b2aa9928 Landed the rest of the liveHandler rewrite that takes advantage of the new closest multi-selector signature (sorry, accidentally committed some of it in the wrong commit: 4daae7a79f). 2009-12-03 11:15:26 -05:00
jeresig
4daae7a79f No need to do the closest match if no selectors are passed in. 2009-12-03 10:51:04 -05:00
Karl Swedberg
ddb86f8d5b added curly braces around all if/else statements 2009-11-28 04:09:14 +08:00
Robert Katic
0bb3998a6a Re-adding zeros removed from slice calls in last commit. 2009-11-26 00:58:39 +08:00
Robert Katic
04dbdb7525 Corrected RegExp to match event namespaces. Fixes #5303. 2009-11-26 00:58:39 +08:00
Andrea Giammarchi
3a23a5c17d Changed the === undefined ready event check to == null since frameElement is usually null and was skipping the normal line of checks. 2009-11-17 10:45:01 -05:00
Rich Dougherty
bf71575bb4 Land Rich's fix for not using window.top to do frame detection. Fixes #4787. 2009-11-11 13:56:39 -05:00
Mr Speaker
5cb1163469 Making sure that you can bind multiple toggles to a single element without problems. Thanks to 'Mr Speaker' for the original patch. Fixes #5274. 2009-11-11 09:46:24 -05:00
John Resig
262fcf7b7b Require that, at least, document.body exists before firing the ready event. This may stop jQuery from working on pages that don't create a document.body (such as Safari, when no body exists) but considering that we've required a document.body since 1.3 and haven't broken any pages, this doesn't appear to be a pressing issue. Used the test case written by dmethvin to verify the bug and the fix. Fixes #4320. 2009-11-09 13:47:53 +01:00
John Resig
24e18d4cae Backing out commit 81bfd9b870, read the ticket incorrectly - and seeing some of the other earlier tickets it's obvious that a more generic solution is needed. Thanks jdalton for the catch. 2009-11-09 13:30:33 +01:00
John Resig
4fd730dca7 Merge branch 'master' of git@github.com:jquery/jquery 2009-11-09 13:01:10 +01:00
lrbabe
d251809912 Making mouseenter and mouseleave work with .live(). 2009-11-09 12:59:54 +01:00
lrbabe
9a69b2cf08 Cleanup bubbling focus and blur events
- Use cached event instead of jQuery.event
- Do not cache event.special if you use it only once
2009-11-09 19:41:43 +08:00
rkatic
3dc5bc5a8b Make liveHandler to use jQuery.lastCloser and speed up internal sorting. 2009-11-08 00:37:05 +08:00
John Resig
81bfd9b870 Make sure that document.body exists, at least, in IE before the ready event is fired. Fixes #5443. 2009-11-07 16:00:43 +01:00
visionmedia
50cf4351a6 Consistant splits using " " instead of ","
This was used in several other areas, and IMO is easier to read
and since nothing is multi-word then we misewell use " "
2009-10-27 08:40:59 +08:00
John Resig
4b5a680f77 Fixed == change in ready. 2009-10-08 18:13:07 +00:00
Yehuda Katz
45dfa3b0fc Probably not the optimal solution, but tests pass. 2009-09-16 08:33:00 +00:00
Ariel Flesler
9ebb2fc654 jquery event: closes #5250. bind(), unbind() and one() support Object Literals (needs some refactor though) 2009-09-16 02:19:18 +00:00
Ariel Flesler
681f4fd3cd jquery event: misc removal 2009-09-14 22:58:20 +00:00
Ariel Flesler
bca8225413 jquery event: fixes #4989. blur and focus events now bubble and can be handled using live(). 2009-09-14 22:04:22 +00:00
Brandon Aaron
f3474c00cd fix for #5198, event memory leak limited to IE only via conditional compilation 2009-09-14 21:14:15 +00:00
John Resig
0a6c5205d2 Make sure that at least one argument is provided to .slice(), in accordance with the spec. Fixes jQuery bug #4942. 2009-07-23 13:22:55 +00:00
John Resig
6fc57be843 Support dynamically loaded copies of jQuery using document ready. Fixes #4889. 2009-07-22 15:03:23 +00:00
Brandon Aaron
ee34b6982a fix for #3533, triggering an event with a colon in the name on a table no longer throws an error in IE 2009-06-17 02:31:45 +00:00
Brandon Aaron
b763cc6602 fix regression in removing live events caused by r6324 2009-05-12 15:43:51 +00:00
Ariel Flesler
d075072768 jquery event: misc change 2009-05-10 14:38:35 +00:00
Brandon Aaron
09b59038a0 unused, left-over code from r6344 2009-05-07 18:09:17 +00:00
Brandon Aaron
811891785f .bind() now accepts an optional thisObject as the last argument which is used to change the value of this in event callbacks. fixes #3699 2009-05-07 00:50:28 +00:00
Brandon Aaron
8f042d8be3 fix for #4234. hover can take one function to use for both enter and leave. 2009-05-06 02:17:24 +00:00
Brandon Aaron
3a9c827bf8 fix for #3286 2009-05-06 01:24:22 +00:00
Brandon Aaron
cbda6c541b fix global event triggering that i broke in r6323 2009-05-01 00:59:27 +00:00
Brandon Aaron
96fd5f18d4 special event refactor left over code 2009-05-01 00:36:21 +00:00
Brandon Aaron
c6db93c373 fix for #2620 2009-05-01 00:21:29 +00:00
Brandon Aaron
a4b8fed8ad only copy guid from handler to modifiedHandler if it does not already have one 2009-05-01 00:02:51 +00:00
Brandon Aaron
aef1989ba7 live event handlers now receive data from trigger, fixes #4532, thanks nbubna 2009-04-30 21:50:15 +00:00
Brandon Aaron
71efbdd3b2 refactor specialAll into add and remove hooks for existing special events, live now accepts optional data param like bind, fixes #4612 and #4613, thanks to Mike Helgeson 2009-04-30 21:44:25 +00:00
Brandon Aaron
287ecdbf67 event clean up 2009-04-30 01:26:09 +00:00
Brandon Aaron
851846aabe .unbind() without any arguments now also unbinds namespaced events. fixes #4609 and #4241 2009-04-29 21:45:58 +00:00
Brandon Aaron
f5690995dd fix for #4268. bind now works with iframe windows. thanks tr4nslator 2009-04-22 04:18:53 +00:00
Brandon Aaron
3715d73f79 fix for #2911 2009-04-22 02:31:29 +00:00
Brandon Aaron
f8ef75eb91 remove trailing spaces 2009-03-23 01:55:17 +00:00
Brandon Aaron
30e760b63f fix for #4189, live/die now work with contexts other than just document 2009-03-20 03:10:07 +00:00
John Resig
dae96f552e Added some more information to the unload event cleanup. 2009-03-19 15:16:02 +00:00
John Resig
985856b823 No longer use arguments.callee or RegExp (use new RegExp, instead) for ES 3.1 and Caja compatibility. Fixes jQuery bug #4251. 2009-02-26 18:00:41 +00:00
Ariel Flesler
48164ee603 jquery event: Fixing event.currentTarget for live(). 2009-02-23 13:27:48 +00:00
Ariel Flesler
0a1b0db347 jquery event: closes #4033. e.currentTarget wasn't being enforced for native events (IE doesn't have it) 2009-02-17 12:38:16 +00:00
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
Brandon Aaron
f3f3238c53 jQuery.event.fix performance boost. An example: click event was previously ~3ms and is now < 1ms. jQuery.event.trigger also got another small boost in performance. 2008-04-28 21:09:27 +00:00
Brandon Aaron
b84b997ea4 Prevent a single event object from being fixed more than once 2008-04-27 23:08:31 +00:00
Brandon Aaron
77bb2c505f Optimization for jQuery.event.fix ... don't send fake event through jQuery.event.fix 2008-04-27 20:37:58 +00:00
Ariel Flesler
25f9974cee jquery core: simplified the code using the new jQuery.makeArray from [5314] where possible. 2008-04-24 21:46:22 +00:00
Brandon Aaron
2efd0b4cc5 Fixed regression with 5276 where return false in first handler of multiple handlers was ignored. And 5276 log message says 200% but I meant 20%. 2008-04-23 18:57:17 +00:00
Jörn Zaefferer
32b1cb3a5c jquery.event: Patch for #2708 2008-04-22 21:59:40 +00:00
Brandon Aaron
6d28ebff85 Some small optimizations to the event module. jQuery.event.trigger over 200% faster in IE and less code. Thanks in large to Ariel Flesler. 2008-04-22 05:23:55 +00:00
Brandon Aaron
5d033dba02 Trigger onclick handlers of links 2008-04-21 20:39:17 +00:00
Scott González
75cb0d8d05 Fixed .unbind('.namespace'). 2008-02-05 19:32:00 +00:00
John Resig
703e89ba30 Added support for .unbind(".test") to unbind all namespaced events on an element. 2008-02-03 04:33:11 +00:00
John Resig
77da94552e Added $().data(), $().removeData(), and .bind("click!"). .data() and .removeData() handle namespaced data, .data() triggers a "set-KEY" event on all modified elements, and .bind("click!") only triggers a click (and no namespaced events). 2008-02-03 04:05:24 +00:00
John Resig
709df93304 Added a fix for bug #2140. Opera doesn't like concating null or undefined values. 2008-01-14 18:46:44 +00:00
Yehuda Katz
87d6bcec31 Fixes bug with charCode, bad 'var' and missing semicolon 2007-12-28 19:08:36 +00:00
Brandon Aaron
c73eadf599 Fixed memory leak in IE with non-native event types 2007-12-21 04:53:33 +00:00
Brandon Aaron
fde3d616ac Removed check to prevent event from being fixed twice. Unfortunately, in IE this is sometimes necessary with its global event object. Binding both a mousedown and mousemove event is an example. 2007-12-21 02:11:26 +00:00
Brandon Aaron
bdd6aca209 Fixing #2081 2007-12-20 19:31:02 +00:00
David Serduke
0419455473 Changed the $(document).ready() code to try and solve some problems in Safari, Opera, and IE. 2007-12-20 06:00:01 +00:00
Brandon Aaron
a7dfbb55d9 Short-circuit jQuery.event.fix if it has already fixed the current event object. 2007-12-19 18:35:58 +00:00
David Serduke
3bb82a34de Second part of the fix for #2071. An empty string "" was being sent to .bind() and when the events were being cleared it went in to an infinite recursive loop till memory was out. The test was !types in the function and changing it to types == undefined fixed the error. 2007-12-19 01:48:05 +00:00
David Serduke
1d7b7b94ef Changed CRLF end of lines to just LF. Other than that there were no changes in this commit. Try svn diff -x --ignore-eol-style -r 4224:4225 to see that. 2007-12-19 01:10:20 +00:00
Richard Worth
76c1889e22 Fixed #1887 - trigger fails if extra is not a function 2007-12-18 03:13:39 +00:00
Brandon Aaron
d1b9ad3cdb Fixed #2069. The ready helper and shortcuts act the same. You can also still bind, unbind and trigger the ready event on the document element but doing so follows the events API unlike the ready helper method. 2007-12-17 20:22:53 +00:00
Brandon Aaron
45e4a52cdd Cleaned up mouseenter and mouseleave special events 2007-12-16 22:18:35 +00:00
David Serduke
859aa6c9df Changed window.frameElement to window == top because of some access denied errors when the iframe wasn't same origin. 2007-12-16 10:33:38 +00:00
David Serduke
97e98591aa Added code so an iframe in IE won't count on doScroll to determine if the dom is ready. We will probably have to do more investigation on a better (and consistant) method for inside an iframe in IE. 2007-12-16 10:08:53 +00:00
Brandon Aaron
7a6978b324 Renaming variables to be more consistent 2007-12-16 04:09:53 +00:00
David Serduke
feb9051c0e Fixed #1781 for warnings created on load by FF javascript.options.strict == true. 2007-12-16 01:03:50 +00:00
Brandon Aaron
b264f789b9 new special events api, ready is now a first class event that you can use bind, unbind or the ready helper, two new events: mouseenter and mouseleave, the hover helper method now uses mouseenter and mouseleave, bind and unbind can now take a space sperated list of event types 2007-12-15 05:55:33 +00:00
Brandon Aaron
540f9304a7 Fix for #2032 2007-12-11 03:17:44 +00:00
Brandon Aaron
91f1299f68 Fix for #1486. Prevent IE from throwing an error when triggering focus on hidden input. 2007-12-08 02:54:09 +00:00
David Serduke
ffbedf0262 Fixed #1039 and #1733 by going through the core API and making them text node and comment node safe. 2007-12-07 01:52:21 +00:00
David Serduke
66fbbec3bb Fixed [1993] although it actually wasn't a bug in the core but rather a misunderstanding of how the extra function was supposed to work in jQuery.event.trigger(). That said, it seems more useful and robust for the code to work the way the ticket author thought it should work so this change was made.
Now, if anything is returned from the extra function it will overwrite the return value of the event handlers.  This should only effect custom events unless someone had an extra function that returned a value other than false which would have been ignored before.
2007-12-03 21:41:10 +00:00
David Serduke
3ae5fbc16a Fixed #1701 by passing through the arguments as suggested. 2007-11-28 22:23:40 +00:00
David Serduke
b26da08821 Fixed #1970 by returning true instead of false when the mouse moves over a sub-element. The side effect is the event will not stop default behavior and will propagate which it didn't used to. I could find no compelling reason to stop those things from happening. 2007-11-27 19:20:36 +00:00
Brandon Aaron
e6a481e533 Fix for #1933 2007-11-19 16:15:51 +00:00
Brandon Aaron
ab96367f12 Fix for #1925 and removed some unnecessary browser sniffing 2007-11-14 21:55:45 +00:00
Brandon Aaron
ee52c89dc9 Fix for #1911 2007-11-14 15:06:48 +00:00
John Resig
a2fc65fd32 From a suggestion by Diego, moved the jQuery.ready() call outside of the try{}catch() block for IE/Safari DOM Ready. 2007-10-15 17:55:54 +00:00
Brandon Aaron
a5f95c88c1 Fix normalization of pageX and pageY event properties in IE (#1571). Thanks wizzud. 2007-10-06 21:00:37 +00:00
Brandon Aaron
92aac3abd6 Fixes memory leaks relating to events in IE with page unload and with jQuery methods remove, html and empty (#1610, #1618, #1697 and #1731). Also re-worked variable names to be more consistent with the core. 2007-10-06 17:04:20 +00:00
John Resig
beebbf8ba4 Safari 2 was having problems with the syntax used for the ready handling. 2007-10-01 14:14:09 +00:00
John Resig
1344a7fd50 Fixed the attribution for the DOM Ready fix - the previously used changes weren't significant. 2007-09-27 20:49:30 +00:00
Brandon Aaron
ee2efbe1e3 Fix for #1153 2007-09-27 18:09:23 +00:00
John Resig
6e8a8c5359 Converted jQuery to use the new DOM Ready technique (by checking scroll). A single setTimeout loop is used for both IE and Safari now. Fixex bugs #1320 and #1561. 2007-09-27 15:23:07 +00:00
John Resig
82eccdfcd0 Make sure that the right event type is always triggered (was causing problems with UI's event triggering). 2007-09-14 23:58:51 +00:00
John Resig
3a4e1233aa Landing the new expando management code. Completely overhauls how data is associated with elements.
Plugins will be most interested in:
- jQuery.data(elem) -> Unique ID for the element
- jQuery.data(elem, name) -> Named data store for the element
- jQuery.data(elem, name, value) -> Saves a value to the named data store
- jQuery.removeData(elem) -> Remove the expando and the complete data store
- jQuery.removeData(elem, name) -> Removes just this one named data store

jQuery's .remove() and .empty() automatically clean up after themselves. Once an element leaves a DOM document their events are no longer intact. Thus, statements like so:
{{{
  $("#foo").remove().appendTo("#bar");
}}}
should be written like so:
{{{
  $("#foo").appendTo("#bar");
}}}
in order to avoid losing the bound events.
2007-09-08 23:31:23 +00:00
John Resig
b4e23b5af0 Reorganzing the jQuery source (first phase). 2007-09-08 12:42:32 +00:00