Changeset 13167

Show
Ignore:
Timestamp:
03/20/08 23:32:30 (10 months ago)
Author:
elazutkin
Message:

dnd: fixes #6273, thx haysmark!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/dnd/move.js

    r13098 r13167  
    3030                // summary: called during the very first move notification, 
    3131                //      can be used to initialize coordinates, can be overwritten. 
    32                 var c = this.constraintBox = this.constraints.call(this, mover), m = mover.marginBox; 
    33                 c.r = c.l + c.w - (this.within ? m.w : 0); 
    34                 c.b = c.t + c.h - (this.within ? m.h : 0); 
     32                var c = this.constraintBox = this.constraints.call(this, mover); 
     33                c.r = c.l + c.w; 
     34                c.b = c.t + c.h; 
     35                if(this.within){ 
     36                        var mb = dojo.marginBox(mover.node); 
     37                        c.r -= mb.w; 
     38                        c.b -= mb.h; 
     39                } 
    3540        }, 
    3641        onMove: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop){ 
     
    134139                        // summary: called once to initialize things; it is meant to be called only once 
    135140                        dojo.dnd.Mover.prototype.onFirstMove.call(this); 
    136                         var c = this.constraintBox = fun.call(this), m = this.marginBox; 
    137                         c.r = c.l + c.w - (within ? m.w : 0); 
    138                         c.b = c.t + c.h - (within ? m.h : 0); 
     141                        var c = this.constraintBox = fun.call(this); 
     142                        c.r = c.l + c.w; 
     143                        c.b = c.t + c.h; 
     144                        if(within){ 
     145                                var mb = dojo.marginBox(this.node); 
     146                                c.r -= mb.w; 
     147                                c.b -= mb.h; 
     148                        } 
    139149                } 
    140150        });