Changeset 7767
- Timestamp:
- 03/22/07 19:42:45 (20 months ago)
- Location:
- trunk/src/dnd2
- Files:
-
- 2 modified
-
manager.js (modified) (4 diffs)
-
source.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dnd2/manager.js
r7766 r7767 47 47 dojo.event.connect(dojo.doc(), "onmousemove", this, "onMouseMove"); 48 48 dojo.event.connect(dojo.doc(), "onmouseup", this, "onMouseUp"); 49 dojo.event.connect(dojo.doc(), "onkeydown", this, "onKeyDown"); 50 dojo.event.connect(dojo.doc(), "onkeyup", this, "onKeyUp"); 49 51 dojo.html.addClass(dojo.body(), "dojoDnd" + (copy ? "Copy" : "Move")); 50 52 }, … … 61 63 dojo.event.disconnect(dojo.doc(), "onmousemove", this, "onMouseMove"); 62 64 dojo.event.disconnect(dojo.doc(), "onmouseup", this, "onMouseUp"); 65 dojo.event.disconnect(dojo.doc(), "onkeydown", this, "onKeyDown"); 66 dojo.event.disconnect(dojo.doc(), "onkeyup", this, "onKeyUp"); 63 67 this.avatar.destroy(); 64 68 this.avatar = null; … … 74 78 s.left = (e.pageX + 10) + "px"; 75 79 s.top = (e.pageY + 10) + "px"; 76 if(this.copy != e.ctrlKey){ 77 this.copy = e.ctrlKey; 78 this.source.markDndStatus(this.copy); 79 this.updateAvatar(); 80 dojo.html.replaceClass(dojo.body(), "dojoDnd" + (this.copy ? "Copy" : "Move"), "dojoDnd" + (this.copy ? "Move" : "Copy")); 81 } 80 if(this.copy != e.ctrlKey){ this.setCopyStatus(e.ctrlKey); } 82 81 } 83 82 }, … … 91 90 this.stopDrag(); 92 91 } 92 }, 93 // keyboard event processors 94 onKeyDown: function(e){ 95 if(this.avatar && e.keyCode == dojo.event.browser.keys.KEY_CTRL && !this.copy){ this.setCopyStatus(true); } 96 }, 97 onKeyUp: function(e){ 98 if(this.avatar && e.keyCode == dojo.event.browser.keys.KEY_CTRL && this.copy){ this.setCopyStatus(false); } 99 }, 100 // utilities 101 setCopyStatus: function(copy){ 102 this.copy = copy; 103 this.source.markDndStatus(this.copy); 104 this.updateAvatar(); 105 dojo.html.replaceClass(dojo.body(), "dojoDnd" + (this.copy ? "Copy" : "Move"), "dojoDnd" + (this.copy ? "Move" : "Copy")); 93 106 } 94 107 }); -
trunk/src/dnd2/source.js
r7766 r7767 42 42 this.mouse_down = false; 43 43 this.target_anchor = null; 44 this.target_valid = false;45 44 this.before = true; 46 45 // states