pamelafox / faded-parsons-static

A way to run Python Faded Parsons problems entirely in the browser.
https://pamelafox.github.io/faded-parsons-static/index.html
Other
9 stars 4 forks source link

Enable mobile draggable code blocks #2

Closed nmstoker closed 2 years ago

nmstoker commented 2 years ago

Currently users need to use a mouse to move the draggable code blocks which stops them being usable on a mobile, but with the inclusion of a slightly modified version of touch-punch they can be made to work on mobile as well.

Touch-punch comes from here: https://github.com/furf/jquery-ui-touch-punch And the modification is based on this SO solution: https://stackoverflow.com/a/18647882/142780

The SO solution is needed because without it, touch-punch causes the input boxes in the code blocks to be unable to accept focus (making them unusable even though you can drag the code blocks around!)

pamelafox commented 2 years ago

Just checked it out locally (on desktop), looks good, merging! (Long-term, I'd love to move out of jQueryUI so that we can use modern bundling for the frontend, but I couldn't find any drag-and-drop libraries that supported both sortable and grid, like jQuery UI does)