Ticket #2063: uidroppable121607.patch
| File uidroppable121607.patch, 2.2 kB (added by mnichols, 10 months ago) |
|---|
-
ui.droppable.js
86 86 var el = e.srcElement; 87 87 do { if(el.droppable) return el; el = el.parentNode; } while (el); //This is only used in IE! references in DOM are evil! 88 88 } 89 if(c && o.accept (c.element)) c.currentTarget = findCurrentTarget(e);89 if(c && o.accept.call(this,c.element)) c.currentTarget = findCurrentTarget(e); 90 90 91 91 c.drag.apply(c, [e]); 92 92 e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true; … … 96 96 97 97 var c = $.ui.ddmanager.current; 98 98 if (!c || c.element == this.element) return; // Bail if draggable and droppable are same element 99 99 c.currentTarget = this;//added 100 100 var o = this.options; 101 if (o.accept (c.element)) {101 if (o.accept.call(this,c.element)) { 102 102 $.ui.plugin.call(this, 'over', [e, this.prepareCallbackObj(c)]); 103 103 $(this.element).triggerHandler("dropover", [e, this.prepareCallbackObj(c)], o.over); 104 104 } … … 107 107 out: function(e) { 108 108 109 109 var c = $.ui.ddmanager.current; 110 if (!c || c.element == this.element) return; // Bail if draggable and droppable are same element 111 110 if (!c || c.element == this.element) return; // Bail if draggable and droppable are same element 112 111 var o = this.options; 113 if (o.accept (c.element)) {112 if (o.accept.call(this,c.element)) { 114 113 $.ui.plugin.call(this, 'out', [e, this.prepareCallbackObj(c)]); 115 114 $(this.element).triggerHandler("dropout", [e, this.prepareCallbackObj(c)], o.out); 116 115 } … … 119 118 drop: function(e) { 120 119 121 120 var c = $.ui.ddmanager.current; 122 if (!c || c.element == this.element) return; // Bail if draggable and droppable are same element 123 121 if (!c || c.element == this.element) return; // Bail if draggable and droppable are same element 124 122 var o = this.options; 125 if(o.accept (c.element)) { // Fire callback123 if(o.accept.call(this,c.element)) { // Fire callback 126 124 if(o.greedy && !c.slowMode) { 127 125 if(c.currentTarget == this.element) { 128 126 $.ui.plugin.call(this, 'drop', [e, {
