Bug Tracker

Ticket #2063: uidraggable121607.patch

File uidraggable121607.patch, 1.2 kB (added by mnichols, 1 year ago)

Draggable using 'call' for accept callback

  • ui.draggable.js

     
    3333            var m = $.ui.ddmanager.droppables; 
    3434            for (var i = 0; i < m.length; i++) { 
    3535                if(m[i].item.disabled) continue; 
    36                 m[i].offset = $(m[i].item.element).offset(); 
    37                 if (t && m[i].item.options.accept(t.element)) //Activate the droppable if used directly from draggables 
     36                m[i].offset = $(m[i].item.element).offset();                
     37                if (t && m[i].item.options.accept.call(m[i].item,t)) //Activate the droppable if used directly from draggables 
    3838                    m[i].item.activate.call(m[i].item, e); 
    3939            } 
    4040        }, 
     
    4545                if (!!oDrop && !oDrop.item.disabled && $.ui.intersect(oDrag, oDrop, oDrop.item.options.tolerance)) 
    4646                    oDrop.item.drop.call(oDrop.item, e); 
    4747            }); 
    48             $.each(oDrops, function(i, oDrop) { 
    49                 if (!oDrop.item.disabled && oDrop.item.options.accept(oDrag.element)) { 
     48            $.each(oDrops, function(i, oDrop) {                 
     49                if (!oDrop.item.disabled && oDrop.item.options.accept.call(oDrop.item,oDrag)) { 
    5050                    oDrop.out = 1; oDrop.over = 0; 
    5151                    oDrop.item.deactivate.call(oDrop.item, e); 
    5252                }