Ticket #2122: uidroppable-fix_element_comparer_and_accept_fn.patch
| File uidroppable-fix_element_comparer_and_accept_fn.patch, 2.8 kB (added by mnichols, 1 year ago) |
|---|
-
ui.droppable.js
66 66 over: function(e) { 67 67 68 68 var draggable = $.ui.ddmanager.current; 69 if (!draggable || draggable.element == this.element) return; // Bail if draggable and droppable are same element 70 71 if (this.options.accept(draggable.element)) { 69 if (!draggable || $(draggable.element)[0] == $(this.element)[0]) return; // Bail if draggable and droppable are same element 70 if (this.options.accept(this.ui(draggable))) { 72 71 $.ui.plugin.call(this, 'over', [e, this.ui(draggable)]); 73 72 $(this.element).triggerHandler("dropover", [e, this.ui(draggable)], this.options.over); 74 73 } … … 77 76 out: function(e) { 78 77 79 78 var draggable = $.ui.ddmanager.current; 80 if (!draggable || draggable.element == this.element) return; // Bail if draggable and droppable are same element79 if (!draggable || $(draggable.element)[0] == $(this.element)[0]) return; // Bail if draggable and droppable are same element 81 80 82 if (this.options.accept( draggable.element)) {81 if (this.options.accept(this.ui(draggable))) { 83 82 $.ui.plugin.call(this, 'out', [e, this.ui(draggable)]); 84 83 $(this.element).triggerHandler("dropout", [e, this.ui(draggable)], this.options.out); 85 84 } … … 88 87 drop: function(e) { 89 88 90 89 var draggable = $.ui.ddmanager.current; 91 if (!draggable || draggable.element == this.element) return; // Bail if draggable and droppable are same element90 if (!draggable || $(draggable.element)[0] == $(this.element)[0]) return; // Bail if draggable and droppable are same element 92 91 93 if(this.options.accept( draggable.element)) {92 if(this.options.accept(this.ui(draggable))) { 94 93 $.ui.plugin.call(this, 'drop', [e, this.ui(draggable)]); 95 94 $(this.element).triggerHandler("drop", [e, this.ui(draggable)], this.options.drop); 96 95 } … … 163 162 if(m[i].item.disabled) continue; 164 163 m[i].offset = $(m[i].item.element).offset(); 165 164 166 if (t && m[i].item.options.accept (t.element)) //Activate the droppable if used directly from draggables165 if (t && m[i].item.options.accept.call(m[i].item,m[i].item.ui(t))) //Activate the droppable if used directly from draggables 167 166 m[i].item.activate.call(m[i].item, e); 168 167 169 168 } … … 175 174 176 175 if (!this.item.disabled && $.ui.intersect(draggable, this, this.item.options.tolerance)) 177 176 this.item.drop.call(this.item, e); 178 179 if (!this.item.disabled && this.item.options.accept (draggable.element)) {177 178 if (!this.item.disabled && this.item.options.accept.call(this.item,this.item.ui(draggable))) { 180 179 this.out = 1; this.over = 0; 181 180 this.item.deactivate.call(this.item, e); 182 181 }
