Changeset 7770
- Timestamp:
- 03/22/07 23:13:40 (22 months ago)
- Files:
-
- 1 modified
-
trunk/src/dnd2/source.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dnd2/source.js
r7769 r7770 4 4 dojo.require("dojo.event.*"); 5 5 dojo.require("dojo.html.style"); 6 dojo.require("dojo.html.layout"); 6 7 7 8 dojo.require("dojo.dnd2.selector"); … … 42 43 this.mouse_down = false; 43 44 this.target_anchor = null; 45 this.target_box = null; 44 46 this.before = true; 45 47 // states … … 64 66 // calculate before/after 65 67 var before = false; 66 /*67 THIS IS A PLACEHOLDER!68 69 68 if(this.current){ 69 if(!this.target_box){ 70 this.target_box = { 71 xy: dojo.html.getAbsolutePosition(this.current, true), 72 wh: dojo.html.getBorderBox(this.current) 73 }; 74 } 70 75 if(this.horizontal){ 71 before = (e. clientX - this.current.clientLeft) < (this.current.offsetWidth / 2);76 before = (e.pageX - this.target_box.xy.x) < (this.target_box.wh.width / 2); 72 77 }else{ 73 before = (e.clientY - this.current.clientTop) < (this.current.offsetHeight / 2); 74 } 75 } 76 */ 78 before = (e.pageY - this.target_box.xy.y) < (this.target_box.wh.height / 2); 79 } 80 } 77 81 if(this.current != this.target_anchor || before != this.before){ 78 82 this.markTargetAnchor(before); … … 189 193 } 190 194 this.target_anchor = this.current; 195 this.target_box = null; 191 196 this.before = before; 192 197 if(this.target_anchor){ … … 198 203 this.removeItemClass(this.target_anchor, this.before ? "Before" : "After"); 199 204 this.target_anchor = null; 205 this.target_box = null; 200 206 this.before = true; 201 207 },