Skip to content
This repository

$.support.touch was dropped from 1.2 #4786

Closed
jtara opened this Issue August 01, 2012 · 7 comments

3 participants

Jon Tara Ghislain Seguin Todd Parker
Jon Tara

Prior to 1.7.2 $.support.touch was being set in jquery.mobile.support.js.

But it's gone. Vanished without a trace.

Problem is, third-party plugins need it. Yes, they can work-around, but this seems rather fundamental. A test is done in events/touch.js Why not put it somewhere accessible so that third-party plugins can make sure they are using the same test as JQM?

Can this be put back?

It's still referenced in the scrollview plugin. I realize scrollview is deprecated. Either the support option should be put back or scrollview should be dropped, since it's now broken without this support variable.

Ghislain Seguin
Collaborator

$.support is not part of jQuery's public API. As the documentation says: "Since jQuery requires these tests internally, they must be performed on every page load. Although some of these properties are documented below, they are not subject to a long deprecation/removal cycle and may be removed once internal jQuery code no longer needs them."

Jon Tara

Yes, I know. And disagree. Strongly.

The test is already being done. It's already being stored in a variable. Just not one that is accessible. What was the purpose of removing it?

If you follow the jQuery documentation to the letter, jQuery (Mobile) still requires this test internally.

"may be removed once internal jQuery code no longer needs them.

The jQuery (Mobile) code still needs it. Thus, it does not meet the criteria for removal.

Further, I dont' think that "they are not subject to a long deprecation/removal cycle" should be interpreted as "they shall be subject to the shortest possible deprecation/removal cycle."

It just stopped exposing it. For no reason.

Unless the reason is to discourage and break third-party plugins.

Ghislain Seguin
Collaborator

The scrollview widget you're referring to is an experiment and is neither maintained nor supported.
When we decoupled the touch event code we realized that $.support.touch was only used by touch.js that's why we stopped exposing it.

Todd Parker

@jtara - we're reviewing this change now, stay tuned.

Todd Parker

After discussing, we've decided to restore $.support.touch to avoid breaking existing code but we're going to document that developers should move away from using this since it's not guaranteed to be there in the future.

We're going to add $.mobile.supportsTouch to the mobile API which that we will commit to supporting as a stable part of the API and recommend that folks use that instead.

Sound good @jtara?

Jon Tara

This sounds like a good resolution.

The quasi-supported/quasi-unsupported nature of $.support has always been unsettling. But that is a jQuery issue. jQuery needs to get off the fence.

It makes sense for jQuery Mobile to not pollute $.support. JQM support variables belong in $.mobile somewhere.

This resolution gives time to third-party developers to remove their use of $.support, while at the same time providing a supported feature variable. It is important for plugins to be able to know what features JQM understands the browser to have, so that they can match that expectation.

Ghislain Seguin gseguin closed this issue from a commit August 08, 2012
Ghislain Seguin Introduced $.mobile.supportsTouch as a supported API and resuscitated…
… $.support.touch though it is still unsupported.

Fixes #4786
fbeeb5b
Ghislain Seguin gseguin closed this in fbeeb5b August 08, 2012
Ghislain Seguin
Collaborator

The new property is actually $.mobile.support.touch

Alexander Schmitz arschmitz referenced this issue from a commit in arschmitz/jquery-mobile August 08, 2012
Ghislain Seguin Introduced $.mobile.supportsTouch as a supported API and resuscitated…
… $.support.touch though it is still unsupported.

Fixes #4786
5ddd64a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.