Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions draggabilly.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ Draggabilly.prototype.dragEnd = function( event, pointer ) {
this.isDragging = false;
// use top left position when complete
if ( transformProperty ) {
this.element.style[ transformProperty ] = '';
var transform = this.element.style[ transformProperty ];
transform = transform.replace( /translate(3d)?\(.*\)/, '' );
this.element.style[ transformProperty ] = transform;
this.setLeftTop();
}
classie.remove( this.element, 'is-dragging' );
Expand Down Expand Up @@ -459,7 +461,9 @@ Draggabilly.prototype.setLeftTop = function() {
Draggabilly.prototype.positionDrag = transformProperty ?
function() {
// position with transform
this.element.style[ transformProperty ] = translate( this.dragPoint.x, this.dragPoint.y );
var transform = this.element.style[ transformProperty ];
transform = transform.replace( /translate(3d)?\(.*\)/, '' );
this.element.style[ transformProperty ] = transform + translate( this.dragPoint.x, this.dragPoint.y );
} : Draggabilly.prototype.setLeftTop;

// ----- staticClick ----- //
Expand All @@ -485,7 +489,9 @@ Draggabilly.prototype.destroy = function() {
this.disable();
// reset styles
if ( transformProperty ) {
this.element.style[ transformProperty ] = '';
var transform = this.element.style[ transformProperty ];
transform = transform.replace( /translate(3d)?\(.*\)/, '' );
this.element.style[ transformProperty ] = transform;
}
this.element.style.left = '';
this.element.style.top = '';
Expand Down