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

Using with Touch Punch for mobile functionality #2

Open
freq32 opened this issue Jun 3, 2015 · 5 comments
Open

Using with Touch Punch for mobile functionality #2

freq32 opened this issue Jun 3, 2015 · 5 comments

Comments

@freq32
Copy link

freq32 commented Jun 3, 2015

I could not get drag and drop to function on Android mobile using http://touchpunch.furf.com/

@camohub
Copy link
Owner

camohub commented Jun 8, 2015

I did not test it. There would be necessary to change some handlers to "starttap/endtap/movetap" manualy cause this plugin uses mousedown event to start dragging, mousemove while dragging and mouse up when you drop element.
There is this line of code which is necessary to rewrite manualy to "starttap" event -
return this.on('mousedown', function(e) ....
And in startDrag() function /at the end/ is code:
state.doc.on('mousemove', dragging).on('mouseup', endDrag);
which should be rewriten to endtap and tapmove events.
But i dont know if it works now. You have to try it.

@camohub
Copy link
Owner

camohub commented Jun 10, 2015

Hi there,
I try to implement touch events in to the plugin, but can't test it. You can find it in master as jquery-sortable-lists-mobile.js. It wont work on Chrome for Android cause there is a bug and I don't know how to solve it now.

@freq32
Copy link
Author

freq32 commented Jun 17, 2015

thanks for the effort, I tried a bit myself.. yes it was on Android. I ended up making a much simpler sortable without nesting for what I needed.

@RootYQ
Copy link

RootYQ commented Apr 3, 2017

i swith touches to changedTouches,changed:

function u(a) {
a.pageX = a.originalEvent.changedTouches[0].pageX;
a.pageY = a.originalEvent.changedTouches[0].pageY;
a.screenX = a.originalEvent.changedTouches[0].screenX;
a.screenY = a.originalEvent.changedTouches[0].screenY
}
, then, it's works fine

@camohub camohub reopened this Apr 16, 2017
@camohub
Copy link
Owner

camohub commented Apr 16, 2017

Are you able to make a pull request? If yes, make a parallel file jquery-sortable-lists-mobile.js from latest jquery-sortable-lists.js file with this changes. If not write me here please.
Thansk.

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