This is a great library, thanks for the work and releasing it!
I was wondering if there was a way to make an element draggable, but only by clicking a handle in the element? That way, the whole element isn't clickable. Thanks!
There's no setting for this so you would have to change the target yourself in your event listeners.
I could implement something like an allowFrom options which would be sort of the reverse of ignoreFrom to only start actions from the matching element or it's children.
I've implemented the allowFrom setting.
* A drag/resize/gesture is started only If the target of the
* `mousedown`, `pointerdown` or `touchstart` event or any of it's
* parents match the given CSS selector or Element.
prolly a non-issue but:
shouldn't this be this._element.querySelector to restrict drag handles to child nodes only? there is no need to take other matching elements into consideration
Limit ignore/allowFrom tests to target's children
You're right, it should only focus on the child nodes. However, the line that you mentioned is only there to test that the given string is a valid CS selector. I've implemented the behaviour in d67646e for both allowFrom and ignoreFrom.
Thanks for mentioning this!
Can you give a sample code snippet about the implementation? Thanks great framework
Here's an implementation based on someone elses jsfiddle.
You can only drag/drop using the handle provided due to
line 2: allowFrom('.handle')