Bug Tracker

Ticket #2063: uidroppable-pass.ui.to.accept.patch

File uidroppable-pass.ui.to.accept.patch, 2.4 kB (added by mnichols, 8 months ago)

Patch successfully passes ui to the accept function of droppable

  • ui.droppable.js

     
    6868            var draggable = $.ui.ddmanager.current; 
    6969            if (!draggable || draggable.element == this.element) return; // Bail if draggable and droppable are same element 
    7070             
    71             if (this.options.accept(draggable.element)) { 
     71            if (this.options.accept(this.ui(draggable))) { 
    7272                $.ui.plugin.call(this, 'over', [e, this.ui(draggable)]); 
    7373                $(this.element).triggerHandler("dropover", [e, this.ui(draggable)], this.options.over); 
    7474            } 
     
    7979            var draggable = $.ui.ddmanager.current; 
    8080            if (!draggable || draggable.element == this.element) return; // Bail if draggable and droppable are same element 
    8181 
    82             if (this.options.accept(draggable.element)) { 
     82            if (this.options.accept(this.ui(draggable))) { 
    8383                $.ui.plugin.call(this, 'out', [e, this.ui(draggable)]); 
    8484                $(this.element).triggerHandler("dropout", [e, this.ui(draggable)], this.options.out); 
    8585            } 
     
    9090            var draggable = $.ui.ddmanager.current; 
    9191            if (!draggable || draggable.element == this.element) return; // Bail if draggable and droppable are same element 
    9292             
    93             if(this.options.accept(draggable.element)) { 
     93            if(this.options.accept(this.ui(draggable))) { 
    9494                $.ui.plugin.call(this, 'drop', [e, this.ui(draggable)]); 
    9595                $(this.element).triggerHandler("drop", [e, this.ui(draggable)], this.options.drop); 
    9696            } 
     
    163163                if(m[i].item.disabled) continue; 
    164164                m[i].offset = $(m[i].item.element).offset(); 
    165165                 
    166                 if (t && m[i].item.options.accept(t.element)) //Activate the droppable if used directly from draggables 
     166                if (t && m[i].item.options.accept.call(m[i].item.options,m[i].item.ui(t))) //Activate the droppable if used directly from draggables 
    167167                    m[i].item.activate.call(m[i].item, e); 
    168168                     
    169169            } 
     
    175175                 
    176176                if (!this.item.disabled && $.ui.intersect(draggable, this, this.item.options.tolerance)) 
    177177                    this.item.drop.call(this.item, e); 
    178                    
    179                 if (!this.item.disabled && this.item.options.accept(draggable.element)) { 
     178                                                   
     179                if (!this.item.disabled && this.item.options.accept.call(this.item,this.item.ui(draggable))) { 
    180180                    this.out = 1; this.over = 0; 
    181181                    this.item.deactivate.call(this.item, e); 
    182182                }