Closed walter-schwarz closed 8 years ago
Interesting request! You can duck-punch a solution with this code:
var dragMove = Draggabilly.prototype.dragMove
Draggabilly.prototype.dragMove = function( event, pointer, moveVector ) {
// do normal logic
dragMove.apply( this, arguments );
this.previousDragPoint = this.previousDragPoint || {};
if ( this.dragPoint.x != this.previousDragPoint.x ||
this.dragPoint.y != this.previousDragPoint.y ) {
this.dispatchEvent( 'dragGridMove', event, [ pointer, moveVector ] );
}
this.previousDragPoint.x = this.dragPoint.x;
this.previousDragPoint.y = this.dragPoint.y;
};
See demo: http://codepen.io/desandro/pen/waMwEp
+1 this issue if you would like to see dragGridMove event added to Draggabilly.
Thank you for the fast reply. It works great.
_______ _ _ _
|__ __| | | | | |
| | | |__ __ _ _ __ | | __ _ _ ___ _ _| |
| | | '_ \ / _` | '_ \| |/ / | | | |/ _ \| | | | |
| | | | | | (_| | | | | < | |_| | (_) | |_| |_|
|_| |_| |_|\__,_|_| |_|_|\_\ \__, |\___/ \__,_(_)
__/ |
|___/
Looks like this feature didn't outside interest. Closing for now :strawberry:
Hello. Could you add a "dragStep" event that is similar to the dragMove event but only fires when the element is actually moved based on the defined grid. If no grid is defined it would behave just like dragMove. Thanks for the great work!