Changeset 7766

Show
Ignore:
Timestamp:
03/22/07 18:55:22 (22 months ago)
Author:
elazutkin
Message:

dnd2: bugfixes for bugs introduced by renaming states

Location:
trunk/src/dnd2
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/dnd2/manager.js

    r7724 r7766  
    2121        overSource: function(source){ 
    2222                if(this.avatar){ 
    23                         this.target = source; 
     23                        this.target = (source && source.target_state != "Disabled") ? source : null; 
     24                        this.avatar.update(); 
    2425                } 
    2526                dojo.event.topic.publish("dnd_source_over", source); 
  • trunk/src/dnd2/source.js

    r7765 r7766  
    5959        // mouse event processors 
    6060        onMouseMove: function(e){ 
    61                 if(this.is_dragging && this.target_state == "disabled"){ return; } 
     61                if(this.is_dragging && this.target_state == "Disabled"){ return; } 
     62                dojo.dnd2.Source.superclass.onMouseMove.call(this, e); 
    6263                var m = dojo.dnd2.manager(); 
    63                 if(this.container_state != "over"){ 
    64                         m.overSource(this); 
    65                 } 
    66                 dojo.dnd2.Source.superclass.onMouseMove.call(this, e); 
    6764                if(this.is_dragging){ 
    6865                        // calculate before/after 
     
    106103                }else if(this.is_dragging){ 
    107104                        var m = dojo.dnd2.manager(); 
    108                         m.canDrop(!this.current || m.source != this || !(this.current.id in this.selection)); 
     105                        m.canDrop(this.target_state != "Disabled" && (!this.current || m.source != this || !(this.current.id in this.selection))); 
    109106                } 
    110107        }, 
     
    155152                this.changeState("Target", ""); 
    156153        }, 
    157         // methods 
     154        // utilities 
     155        onOverEvent: function(){ 
     156                dojo.dnd2.Source.superclass.onOverEvent.call(this); 
     157                dojo.dnd2.manager().overSource(this); 
     158        }, 
    158159        onOutEvent: function(){ 
    159160                dojo.dnd2.Source.superclass.onOutEvent.call(this); 
    160161                dojo.dnd2.manager().outSource(this); 
    161162        }, 
     163        // methods 
    162164        checkAcceptance: function(source, nodes){ 
    163165                if(this == source){ return true; }