[Pkg-javascript-commits] [dojo] 01/04: Copying changes for DnD, !strict, refs #6155, refs #7944.
David Prévot
taffit at moszumanska.debian.org
Mon May 11 20:12:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag 1.2.2
in repository dojo.
commit b165698afdee5f4d392053b5318088bceb98e033
Author: Eugene Lazutkin <eugene at lazutkin.com>
Date: Thu Nov 13 00:40:31 2008 +0000
Copying changes for DnD, !strict, refs #6155, refs #7944.
git-svn-id: http://svn.dojotoolkit.org/src/branches/1.2/dojo@15664 560b804f-0ae3-0310-86f3-f6aa0a117693
---
dnd/Manager.js | 5 ++++-
dnd/Moveable.js | 11 +++++++----
dnd/Mover.js | 4 ++--
dnd/Source.js | 15 +++++++++++----
4 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/dnd/Manager.js b/dnd/Manager.js
index 7df817c..38878b1 100644
--- a/dnd/Manager.js
+++ b/dnd/Manager.js
@@ -60,7 +60,10 @@ dojo.declare("dojo.dnd.Manager", null, {
dojo.connect(dojo.doc, "onmousemove", this, "onMouseMove"),
dojo.connect(dojo.doc, "onmouseup", this, "onMouseUp"),
dojo.connect(dojo.doc, "onkeydown", this, "onKeyDown"),
- dojo.connect(dojo.doc, "onkeyup", this, "onKeyUp")
+ dojo.connect(dojo.doc, "onkeyup", this, "onKeyUp"),
+ // cancel text selection and text dragging
+ dojo.connect(dojo.doc, "ondragstart", dojo.stopEvent),
+ dojo.connect(dojo.body(), "onselectstart", dojo.stopEvent)
];
var c = "dojoDnd" + (copy ? "Copy" : "Move");
dojo.addClass(dojo.body(), c);
diff --git a/dnd/Moveable.js b/dnd/Moveable.js
index eef917d..9cb3cd8 100644
--- a/dnd/Moveable.js
+++ b/dnd/Moveable.js
@@ -51,8 +51,10 @@ dojo.declare("dojo.dnd.Moveable", null, {
// e: Event: mouse event
if(this.skip && dojo.dnd.isFormElement(e)){ return; }
if(this.delay){
- this.events.push(dojo.connect(this.handle, "onmousemove", this, "onMouseMove"));
- this.events.push(dojo.connect(this.handle, "onmouseup", this, "onMouseUp"));
+ this.events.push(
+ dojo.connect(this.handle, "onmousemove", this, "onMouseMove"),
+ dojo.connect(this.handle, "onmouseup", this, "onMouseUp")
+ );
this._lastX = e.pageX;
this._lastY = e.pageY;
}else{
@@ -72,8 +74,9 @@ dojo.declare("dojo.dnd.Moveable", null, {
onMouseUp: function(e){
// summary: event processor for onmouseup, used only for delayed drags
// e: Event: mouse event
- dojo.disconnect(this.events.pop());
- dojo.disconnect(this.events.pop());
+ for(var i = 0; i < 2; ++i){
+ dojo.disconnect(this.events.pop());
+ }
dojo.stopEvent(e);
},
onSelectStart: function(e){
diff --git a/dnd/Mover.js b/dnd/Mover.js
index 672c217..9d4ef37 100644
--- a/dnd/Mover.js
+++ b/dnd/Mover.js
@@ -21,8 +21,8 @@ dojo.declare("dojo.dnd.Mover", null, {
dojo.connect(d, "onmousemove", this, "onMouseMove"),
dojo.connect(d, "onmouseup", this, "onMouseUp"),
// cancel text selection and text dragging
- dojo.connect(d, "ondragstart", dojo, "stopEvent"),
- dojo.connect(d, "onselectstart", dojo, "stopEvent"),
+ dojo.connect(d, "ondragstart", dojo.stopEvent),
+ dojo.connect(d.body, "onselectstart", dojo.stopEvent),
firstEvent
];
// notify that the move has started
diff --git a/dnd/Source.js b/dnd/Source.js
index 35f46b0..6582745 100644
--- a/dnd/Source.js
+++ b/dnd/Source.js
@@ -30,11 +30,15 @@ dojo.dnd.__SourceArgs = function(){
// accept: Array?
// list of accepted types (text strings) for a target; defaults to
// ["text"]
- // horizontal: Boolean?
- // a horizontal container, if true, vertical otherwise or when omitted
+ // autoSync: Boolean
+ // if true refreshes the node list on every operation; false by default
// copyOnly: Boolean?
// copy items, if true, use a state of Ctrl key otherwise,
// see selfCopy and selfAccept for more details
+ // delay: Number
+ // the move delay in pixels before detecting a drag; 0 by default
+ // horizontal: Boolean?
+ // a horizontal container, if true, vertical otherwise or when omitted
// selfCopy: Boolean?
// copy items by default when dropping on itself,
// false by default, works only if copyOnly is true
@@ -45,8 +49,10 @@ dojo.dnd.__SourceArgs = function(){
// allows dragging only by handles, false by default
this.isSource = isSource;
this.accept = accept;
- this.horizontal = horizontal;
+ this.autoSync = autoSync;
this.copyOnly = copyOnly;
+ this.delay = delay;
+ this.horizontal = horizontal;
this.selfCopy = selfCopy;
this.selfAccept = selfAccept;
this.withHandles = withHandles;
@@ -437,8 +443,9 @@ dojo.declare("dojo.dnd.Source", dojo.dnd.Selector, {
// summary: checks if user clicked on "approved" items
// e: Event: mouse event
if(!this.withHandles){ return true; }
- for(var node = e.target; node && !dojo.hasClass(node, "dojoDndItem"); node = node.parentNode){
+ for(var node = e.target; node; node = node.parentNode){
if(dojo.hasClass(node, "dojoDndHandle")){ return true; }
+ if(dojo.hasClass(node, "dojoDndItem")){ break; }
}
return false; // Boolean
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git
More information about the Pkg-javascript-commits
mailing list