Guest User

Untitled

a guest
Jul 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. cancelDrag: function() {
  2. var target = this._lastTarget,
  3. loc = this.get('location');
  4.  
  5. if (target && target.dragExited) target.dragExited(this, this._lastMouseDraggedEvent);
  6.  
  7. if (this.get('sourceIsDraggable')) {
  8. this._destroyGhostView();
  9.  
  10. if (this.get('ghost')) {
  11. if (this._dragViewWasVisible) this._getDragView().set('isVisible', YES);
  12. this._dragViewWasVisible = null;
  13. }
  14. }
  15.  
  16. var source = this.source;
  17. if (source && source.dragDidEnd) source.dragDidEnd(this, loc, SC.DRAG_NONE);
  18.  
  19. /*********************************************************************************************
  20. * test by cyril
  21. * code taken from mouseUp()
  22. * notify all drop targets that the drag ended
  23. */
  24. var ary = this._dropTargets() ;
  25. for (var idx=0, len=ary.length; idx<len; idx++) {
  26. try {
  27. ary[idx].tryToPerform('dragEnded') ;
  28. } catch (ex2) {
  29. console.error('Exception in SC.Drag.mouseUp(dragEnded on %@): %@'.fmt(ary[idx], ex2)) ;
  30. }
  31. }
  32. /**********************************************************************************************/
  33. this._lastTarget = null;
  34. this._dragInProgress = NO;
  35. },
Add Comment
Please, Sign In to add comment