Commit graph

104 commits

Author SHA1 Message Date
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 8356871a55 testrunner: focus & blur events could fail if the window isn't focused 2009-09-15 17:11:15 +00:00
Ariel Flesler 5e0da8c036 testrunner: resetting the scroll position after focusing a field 2009-09-14 23:28:21 +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 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 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 4460d5ad59 unit tests for using jQuery events on non-dom elements. fixes #3439. thanks morgan 2009-05-04 04:54:09 +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 45b8d2531e enable test for binding events cross-frame that was fixed in r6316 2009-04-29 22:04:41 +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 30e760b63f fix for #4189, live/die now work with contexts other than just document 2009-03-20 03:10:07 +00:00
Ariel Flesler 48164ee603 jquery event: Fixing event.currentTarget for live(). 2009-02-23 13:27:48 +00:00
John Resig 8d9aa015c1 Changed the currentTarget test - no need to test the native event triggering for this test. 2009-02-17 17:22:59 +00:00
Ariel Flesler 63f8bb7027 testrunner: Misc 2009-02-17 12:42:46 +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 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
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 eced38a30d testrunner: refactored unbind's tests. Including one for #3538, passing since last commit. 2009-01-08 22:22:33 +00:00
John Resig b1e161466c Disabled an extra event binding. 2009-01-05 23:06:57 +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 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
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 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 67ded9a36a Made sure that the correct event.taget is being used in event bubbling. 2008-12-22 02:02:05 +00:00
John Resig 25885e07b2 Added support for bubbling triggered events. 2008-12-22 01:57:06 +00:00
John Resig 77344f4c50 Added support for multiple-namespaced events (in bind, trigger, and unbind). 2008-12-19 04:34:12 +00:00
Jörn Zaefferer 12bb969411 core: tests cleanup for compability with qunit updates: stop() now actually accepts an argument (ajax.js); selectors should be confined to fixture(event.js) 2008-10-24 14:40:58 +00:00
Ariel Flesler b860c30b82 test runner: Commented 2 tests that jam the suite. 2008-10-21 01:48:23 +00:00
Ariel Flesler 9e48649729 test runner: the changes are:
- Replaced all the $ for jQuery in the tests and suite.
- Added a noConflict to testrunner.js.
- Modified the test for noConflict() so that it still work.
- Added jQuery 1.2.1 and 1.2.3 to otherlibs.
2008-05-28 23:18:25 +00:00
Ariel Flesler 407c5eb430 test runner: extra test case, [5501] 2008-05-08 16:25:12 +00:00
Ariel Flesler ba48be3ada test runner: translated all the ok() with '==' to equals(), as it gives more information on failures. 2008-05-06 18:56:02 +00:00
Ariel Flesler d822c0c214 test runner: adding a test case for $.fn._toggle with more than 2 functions. 2008-04-29 22:20:02 +00:00
Jörn Zaefferer 32b1cb3a5c jquery.event: Patch for #2708 2008-04-22 21:59:40 +00:00
Brandon Aaron 5d033dba02 Trigger onclick handlers of links 2008-04-21 20:39:17 +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
Jörn Zaefferer 2fa855601e fix for #2114; refactored tests for bind() to highlight failing select-change-test 2008-01-14 09:33:08 +00:00
John Resig 3261544c38 Fixed #2027 - make sure that cloned elements (within appendTo, etc.) have their events cloned by default. 2007-12-20 13:36:56 +00:00
David Serduke b740fe5632 Fixed a problem in the unit tests for IE where an optimization made the test case not work. The optimization was fine. It was the unit test that was taking a short cut which caused it to fail after the optimization went in. 2007-12-20 07:39:35 +00:00
Jörn Zaefferer 70ae356e4e Test for #2069 2007-12-17 17:39: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 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
John Resig d5f2129ac4 Fixed an issue with the suite expecting a different result for the changed triggerHandler behavior. 2007-09-15 02:23:08 +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 6728e3cf74 Finished up some of the reorganization. 2007-09-08 12:46:01 +00:00
Renamed from test/unit/eventTest.js (Browse further)