Commit graph

27 commits

Author SHA1 Message Date
John Bender
57079e1d6b add the ability to disable native orientation change support Fixes #793
the frequency of the triggered event in certain android releases ( 2.1, 2.2) appears to be dependent on a host of things other than an actual orientation change, eg alerts, zoom, and scrolling. This provides a way for the user to disable it in favor for using throttled resize while still making use of the window.orientation where its available for reliability
2011-10-04 11:54:26 -07:00
John Bender
a0ddaab8e3 fix for incorrect portrait of lanscape value
The value attached to the event passed into handlers was based soley on screensize which is problematic given that some implementations (eg Android 2.3) don't change the screensize until after the event is fired. The orientation property appears to report a better value where it is provided so the solution is to prefer what it reports and then fallback to the screensize caculation where necessary.
2011-10-04 11:54:25 -07:00
John Bender
a20bb72a29 whitespace in events 2011-10-04 11:54:25 -07:00
Kin Blas
abb812cc01 Fixes for issue 1464 - No way to stop a link from being followed with some custom event (tap, taphold)
jquery.mobile.vmouse.js:

	- Modified triggerVirtualEvent() so that it returns the virtual event instead of the isDefaultPrevented() result of the virtual event.

		- Updated all references to triggerVirtualEvent() that relied on the boolean return value to instead check the isDefaultPrevented() call on the event now returned.

			- Updated mouseEventCallback() to propagate the iDefaultPrevented(), isPropagationStopped(), and stopImmediatePropagation() values from the virtual event on to the  original mouse event.

			jquery.mobile.event.js

				- Modified the "taphold" trigger code to create a new $.Event() instead of passing the stale vmousedown event.

					- Added clearTapTimer() which is called from a new vmouseup binding, to prevent the timer from firing between the tie the finger/mouse goes up and the click event is dispatched.

					- Added some propagation tests for the "tap" event. Tests for "taphold" will have to wait until we fix the problem where multiple taphold timers are fired off when an element and one of its ancestors is bound to taphold.
2011-09-07 10:09:00 -04:00
mlitwin
1ef7313e39 Bug 1992; Swipe threshold constants are configurable 2011-07-02 08:23:52 -07:00
Rick Waldron
19e36d2fff jQuery core style guide conformance: jquery.mobile.event.js - fix string concat & split 2011-06-29 11:46:50 -04:00
Rick Waldron
05059f30d5 jQuery core style guide conformance: jquery.mobile.event.js 2011-06-28 23:48:20 -04:00
Rick Waldron
42f0b64262 jQuery core style guide conformance: jquery.mobile.event.js 2011-06-28 19:47:21 -04:00
scottjehl
8c6164dbf0 Added new throttledresize special event, including unit tests. This event prevents browsers from running continuous callbacks on resize, which we use internally for orientationchange in browsers like IE. It still ensures that a held event will execute after the timeout, so logic that depends on the final conditions after a resize is complete will still execute properly. This improves performance noticeably, and... Fixes #1496. Fixes #1848. Fixes #1422.
The included tests pass most of the time, but they need improvements as they will occasionally fail due to faulty timing in the tests themselves, as far as I can tell (the code tests out fine in our functional demos).
2011-06-18 11:41:47 -04:00
scottjehl
90fb871ee8 referenced the full object to avoid a minifier issue when trying to reference a local variable. Will follow up on this... 2011-06-18 09:19:45 -04:00
Martin Kou
4dc2560895 Fixed yet another duplicate tap event bug. 2011-04-06 23:39:41 +08:00
Kin Blas
c7aadd8a47 Fix for issue 1379 - vmouseclick or vclick?
- Changed typo "vmouseclick" to "vclick".
2011-04-05 15:57:37 -07:00
Kin Blas
b0a667ae44 Fixed typo in my last checkin for converting tap to virtual mouse events. It was preventing tap from actually firing so things like the cancel button link in a search textfield was being followed. 2011-03-11 16:12:58 -08:00
Kin Blas
d2594ec585 Reworked tap/taphold code so that it makes use of vmousecancel to detect when the user has scrolled the page. Also refactored some of the event handler calling code into a function. I'm still not sure why the handler is called directly versus using the jQuery trigger() method which would allow bubbling. 2011-03-09 14:14:53 -08:00
Kin Blas
48389d1ee1 Fixed bad variable name in teardown method of jquery.mobile.vmouse.js. It was causing an error that made one() bindings fail to fire off their handlers.
Modified select and slider code to use virtual events.

Modified tap and taphold code to make use of the virtual events.
2011-02-18 17:39:04 -08:00
scottjehl
977e075ece improved tap event and added a quick event logger page so we can get these neglected events in order. 2011-01-23 19:34:17 -05:00
D. Elmo Peele
1a21b0581c Avoid triggering a 'tap' event if the event target on touchStop differs from the original touchStart target. 2011-01-12 07:47:17 +08:00
scottjehl
93179f9a3d updated comment about license to match other jQuery projects - MIT "or" GPL 2010-11-19 22:47:47 -05:00
scottjehl
a24196e550 dolla dolla bills y'all.
Fixes #126, Fixes #346
2010-11-11 10:50:28 -05:00
Ben Alman
69e1e32c88 rewrote the orientationchange special event to allow both binding and unbinding of single or multiple event handlers as well as manual triggering. jQuery.event.special.orientationchange.orientation might not need to be public (which could save a few bytes). 2010-11-05 19:25:26 +00:00
D. Elmo Peele
95bac6f5a0 Fix tap event to ignore small movements. 2010-11-05 11:14:53 +08:00
scottjehl
81fe1d2aea Used documentElement.clientWidth/Height. Fixes #313 2010-11-04 10:44:35 -04:00
Dave Penfold
ae342659df Increase y axis threshold on swiping from 20 to 75 2010-11-03 02:12:05 +08:00
scottjehl
e4e8f1ddc4 added closures to event and support 2010-11-01 14:33:54 -04:00
John Resig
23263a967b Make sure the document body exists before determining orientation change, at least. 2010-10-14 13:12:47 -04:00
Scott González
2ac5e0a755 Wait for 750ms before triggering taphold. Trigger tap even if a taphold occurs. 2010-10-12 11:34:31 -04:00
Scott González
5c3d35574f Renamed files. 2010-10-07 11:30:48 -04:00
Renamed from js/jQuery.mobile.event.js- (Browse further)