Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems integrating with JQuery UI v 1.12.1 #4

Closed
joannecas opened this issue Jun 10, 2019 · 7 comments
Closed

Problems integrating with JQuery UI v 1.12.1 #4

joannecas opened this issue Jun 10, 2019 · 7 comments

Comments

@joannecas
Copy link

joannecas commented Jun 10, 2019

Good chance I am doing something dumb. Hoping @RWAP can help me out please. I've tried a bit of problem solving to get touch punch to work on ipad/iphone browsers. I'm working within the Adapt Learning Framework (using Backbone) and building the drag and drop functionality into a plugin component. In this component, I'm using passed in variables in a sortable() function with a simple connectWith. It works fine on desktop and worked well prior to 6 months ago in several heavily tested components.

I should also note that I haven't been able to get primefaces' version to work either.
primefaces/primefaces#4213

And none of the solutions from this thread have solved the issue
furf#309

Implementing this version direct in the place of furf's version, I run into
jquery.ui.touch-punch.js:22 Uncaught TypeError: Cannot read property 'mouse' of undefined

To get around this, I can define JQuery before the function using factory and this eliminates undefined property of 'mouse'.

(function( factory ) {
  if ( typeof define === "function" && define.amd ) {

    console.log("what is factory", factory);

    // AMD. Register as an anonymous module.
    define([ "jquery" ], factory );
  } else {
    // Browser globals
    factory( jQuery );
  }
}

Running through with logs, $.support.touch returns true, mouseProto is defined, but I am still not triggering any of the functions, nothing works on touch devices and no console errors or warnings appear.

What would I be doing wrong?

@RWAP RWAP closed this as completed in ab14010 Jun 11, 2019
@RWAP
Copy link
Owner

RWAP commented Jun 11, 2019

It is hard to say - as you may be aware, I didn't write this - I don't even have a smartphone!

That said, my clients are using jQuery, jQUery-ui and this version of touch-punch on iOS devices without a problem (including sortable). It could be your version of iOS, or the interaction with another plugin.

I don't have enough knowledge of iOS to know what is going on here and why it works for my clients, but not for you...

@RWAP RWAP reopened this Jun 11, 2019
@RWAP
Copy link
Owner

RWAP commented Aug 8, 2019

@joannecas Have you tried the latest version of this branch to see if it now fixes your issue?

@melloware
Copy link

@RWAP Is this fork a rollup of most of the patches found on Pull Requests on the main Touch Punch page? I was trying to do the same thing myself and integrate certain patches but is yours more comprehensive? Any info would be much appreciated.

@RWAP
Copy link
Owner

RWAP commented Aug 17, 2019

It is an attempted rollup - but some of the patches don't work with each other.

This therefore evolved into merging the various patches which we found were required and enabled the plugin to work properly on our own website.

There are probably some patches still missing but I don't think so.

@melloware
Copy link

@RWAP awesome work. I may submit a PR or two to you for review. You can always throw them out if not interested.

@melloware
Copy link

@joannecas I just upgraded PrimeFaces to use this version of touchpunch and everything is working fine with it.

Jquery UI 1.12.1
Jquery 3.4.1

The only change I made was to change "bind" and "unbind" to "on" and "off" which is the Jquery 3.4.1 way of events now.

@RWAP I think this ticket can be closed.

@RWAP
Copy link
Owner

RWAP commented Aug 19, 2019

Thanks - have changed the .bind and .unbind in the main code - as this works with jQuery v1.7 onwards

@RWAP RWAP closed this as completed Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants