Robin Savinsky
Robin Savinsky

Reputation: 63

Touch punch not working on first page load with jQuery Mobile and jQuery sortable

I have a site running on Ruby on Rails that is using jQuery 2.0.3. jQuery-UI 1.11.4 and jQuery mobile 1.4.5. I have a drag and drop sortable list implemented using the 'rails_sortable' gem that works perfectly on desktop but not mobile, so I added touch-punch. This basically solved the problem, but only if I refresh the page after the initial page load. It will not work on the first page load. FYI: I'm sorting by a handle on mobile, but the entire list element on desktop.

NOTE: The 'rails_sortable' gem is just a wrapper of jquery.ui.sortable 1.11.4, so it accepts all of sortable options for that version.

The jquery-ui-touch-punch is the last file loaded, so it is loaded after all the other jQuery libraries. The browser developer tool indicates the file was loaded successfully. I even added a console.log to the bottom of the jquery-ui-touch-punch script that states it was loaded. I added a phantom querystring to the jquery-ui-touch-punch to make sure jQuery mobile wasn't caching the file.

I'm out of ideas on how to address this issue and why touch-punch is only working after a page refresh. Any help would be appreciated.

I'm using Query UI Touch Punch 0.2.3.

The site is a proprietary site and only accessible by user login.

Upvotes: 0

Views: 458

Answers (1)

RWAP
RWAP

Reputation: 37

Also try the RWAP fork of touch-punch - it incorporates the latest recommended changes to that code and has been tested with latest versions of jQuery

Upvotes: 0

Related Questions