Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cancelDrag: function() {
- var target = this._lastTarget,
- loc = this.get('location');
- if (target && target.dragExited) target.dragExited(this, this._lastMouseDraggedEvent);
- if (this.get('sourceIsDraggable')) {
- this._destroyGhostView();
- if (this.get('ghost')) {
- if (this._dragViewWasVisible) this._getDragView().set('isVisible', YES);
- this._dragViewWasVisible = null;
- }
- }
- var source = this.source;
- if (source && source.dragDidEnd) source.dragDidEnd(this, loc, SC.DRAG_NONE);
- /*********************************************************************************************
- * test by cyril
- * code taken from mouseUp()
- * notify all drop targets that the drag ended
- */
- var ary = this._dropTargets() ;
- for (var idx=0, len=ary.length; idx<len; idx++) {
- try {
- ary[idx].tryToPerform('dragEnded') ;
- } catch (ex2) {
- console.error('Exception in SC.Drag.mouseUp(dragEnded on %@): %@'.fmt(ary[idx], ex2)) ;
- }
- }
- /**********************************************************************************************/
- this._lastTarget = null;
- this._dragInProgress = NO;
- },
Add Comment
Please, Sign In to add comment