Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Introduced $.mobile.supportsTouch as a supported API and resuscitated…

… $.support.touch though it is still unsupported.

Fixes #4786
  • Loading branch information...
commit fbeeb5b82c65be3dfee39b8a9ce4df39bccf3f85 1 parent 0b32a26
Ghislain Seguin gseguin authored
4 js/events/touch.js
View
@@ -3,7 +3,7 @@
//>>label: touch
//>>group: Events
-define( [ "jquery", "../jquery.mobile.vmouse" ], function( $ ) {
+define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, window, undefined ) {
@@ -23,7 +23,7 @@ define( [ "jquery", "../jquery.mobile.vmouse" ], function( $ ) {
}
});
- var supportTouch = "ontouchend" in document,
+ var supportTouch = $.mobile.supportsTouch,
scrollEvent = "touchmove scroll",
touchStartEvent = supportTouch ? "touchstart" : "mousedown",
touchStopEvent = supportTouch ? "touchend" : "mouseup",
1  js/index.php
View
@@ -9,6 +9,7 @@
'jquery.ui.widget.js',
'jquery.mobile.widget.js',
'jquery.mobile.media.js',
+ 'jquery.mobile.support.touch.js',
'jquery.mobile.support.orientation.js',
'jquery.mobile.support.js',
'jquery.mobile.vmouse.js',
2  js/jquery.mobile.support.js
View
@@ -2,7 +2,7 @@
//>>description: Assorted tests to qualify browsers by detecting features
//>>label: Support Tests
//>>group: Core
-define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.media", "./jquery.mobile.support.orientation" ], function( $ ) {
+define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.media", "./jquery.mobile.support.touch", "./jquery.mobile.support.orientation" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
18 js/jquery.mobile.support.touch.js
View
@@ -0,0 +1,18 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Touch feature test
+//>>label: Touch support test
+//>>group: Core
+
+define( [ "jquery" ], function( jQuery ) {
+//>>excludeEnd("jqmBuildExclude");
+ (function( $, undefined ) {
+ $.extend( $.support, {
+ touch: "ontouchend" in document
+ });
+ $.extend( $.mobile, {
+ supportsTouch: $.support.touch
+ });
+ }( jQuery ));
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+});
+//>>excludeEnd("jqmBuildExclude");
Please sign in to comment.
Something went wrong with that request. Please try again.