Skip to content

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