1.  
  2. var undoMove = function(e) {
  3. var lastMoved = DashboardManager.lastMoved;
  4. if (lastMoved) {
  5. lastMoved = lastMoved.pop();
  6. if (lastMoved && lastMoved.positions.length > 1) {
  7. var start = lastMoved.popPosition();
  8. var end = lastMoved.popPosition();
  9. if (start && end) {
  10. var locationAnimator = new BiLocationAnimator(start.left, start.top, end.left, end.top, 500, false, BiComponentAnimation.CONSTANT_SPEED, lastMoved, BiFpsGenerator.DEFAULT_FRAME_RATE, false);
  11. locationAnimator.start();
  12. lastMoved.addPosition(end.left, end.top);
  13. locationAnimator.addEventListener("animationend", function(e){this.dispose()});
  14. }
  15. }
  16. }
  17. }
  18. undoBtn.addEventListener("click", undoMove);
  19.  
  20.