Skip to content

Commit

Permalink
Changed revert to right and bottom coordinates
Browse files Browse the repository at this point in the history
Revert does not move back to the right coordinates. They x and y coordinates should be right and bottom, not top and left. This way the element moved snaps back to its exact original position, and not an offset position.
  • Loading branch information
johnpmitsch committed May 12, 2015
1 parent 5b54f77 commit 7d1cee3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jquery.pep.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@
this.moveToUsingTransforms(-this.xTranslation(),-this.yTranslation());
}

this.moveTo(this.initialPosition.left, this.initialPosition.top);
this.moveTo(this.initialPosition.right, this.initialPosition.bottom);
};

// requestAnimationFrame();
Expand Down

5 comments on commit 7d1cee3

@inversiondk
Copy link

Choose a reason for hiding this comment

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

After this change has been made my revert no longer works.
If I change the line back to using "left" and "top" then everything works fine again.

@briangonzalez
Copy link
Owner

Choose a reason for hiding this comment

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

@inversiondk

@johnpmitsch Mind looking into that?

@johnpmitsch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@inversiondk @briangonzalez Thanks for the heads up, I'll look into it today

@johnpmitsch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@briangonzalez @inversiondk I figured out that the revert does not work correctly when place: false option is added, which I needed so my div's do not stack on top of one another.
adding something on 685 like this fixes the issue. I'll submit a pull request

if (this.options.place) {
      this.moveTo(this.initialPosition.top, this.initialPosition.left);
    }

@Anaphase
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we get #163 merged then?

Please sign in to comment.