Skip to content

Commit fbeeb5b

Browse files
committed
Introduced $.mobile.supportsTouch as a supported API and resuscitated $.support.touch though it is still unsupported.
Fixes jquery-archive#4786
1 parent 0b32a26 commit fbeeb5b

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

js/events/touch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//>>label: touch
44
//>>group: Events
55

6-
define( [ "jquery", "../jquery.mobile.vmouse" ], function( $ ) {
6+
define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch" ], function( $ ) {
77
//>>excludeEnd("jqmBuildExclude");
88

99
(function( $, window, undefined ) {
@@ -23,7 +23,7 @@ define( [ "jquery", "../jquery.mobile.vmouse" ], function( $ ) {
2323
}
2424
});
2525

26-
var supportTouch = "ontouchend" in document,
26+
var supportTouch = $.mobile.supportsTouch,
2727
scrollEvent = "touchmove scroll",
2828
touchStartEvent = supportTouch ? "touchstart" : "mousedown",
2929
touchStopEvent = supportTouch ? "touchend" : "mouseup",

js/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
'jquery.ui.widget.js',
1010
'jquery.mobile.widget.js',
1111
'jquery.mobile.media.js',
12+
'jquery.mobile.support.touch.js',
1213
'jquery.mobile.support.orientation.js',
1314
'jquery.mobile.support.js',
1415
'jquery.mobile.vmouse.js',

js/jquery.mobile.support.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//>>description: Assorted tests to qualify browsers by detecting features
33
//>>label: Support Tests
44
//>>group: Core
5-
define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.media", "./jquery.mobile.support.orientation" ], function( $ ) {
5+
define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.media", "./jquery.mobile.support.touch", "./jquery.mobile.support.orientation" ], function( $ ) {
66
//>>excludeEnd("jqmBuildExclude");
77
(function( $, undefined ) {
88

js/jquery.mobile.support.touch.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
2+
//>>description: Touch feature test
3+
//>>label: Touch support test
4+
//>>group: Core
5+
6+
define( [ "jquery" ], function( jQuery ) {
7+
//>>excludeEnd("jqmBuildExclude");
8+
(function( $, undefined ) {
9+
$.extend( $.support, {
10+
touch: "ontouchend" in document
11+
});
12+
$.extend( $.mobile, {
13+
supportsTouch: $.support.touch
14+
});
15+
}( jQuery ));
16+
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
17+
});
18+
//>>excludeEnd("jqmBuildExclude");

0 commit comments

Comments
 (0)