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

Touch drag-and-drop support for toolbox #439

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cubiclesoft
Copy link

A small set of changes that adds drag-and-drop support for touch devices on the floating toolbox.

Demo:

https://cubiclesoft.com/Unrelated/ContentToolsDragTest/sandbox/

@cubiclesoft
Copy link
Author

This PR may resolve closed issue #382.

Copy link

@indykoning indykoning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 357 - 362, src/scripts/ui/toolbox.coffee:
I don't know coffeeScript but in normal javascript this might be a oneliner solution:
(ev.type == 'touchmove' ? ev.touches[0].clientX : ev.clientX)
It's a shorthand version of an if. This would remove the need for the @_domElement.style.left =
I do not know if it works the same way in coffeescript.
Other than that great work, can't wait for this to be merged!

@cubiclesoft
Copy link
Author

As far as I know, CoffeeScript doesn't and won't ever support the ternary operator. It's got if-then-else and unless. Attempting to use the ternary operator in CoffeeScript results in a transpiler error. Sometimes you can write Javascript or something close enough to it and sometimes you can't.

https://stackoverflow.com/questions/10146080/ternary-operation-in-coffeescript

Also, I attempted to stick with the coding style of the surrounding code in this repository.

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

Successfully merging this pull request may close these issues.

2 participants