summaryrefslogtreecommitdiff
path: root/includes/js/dojo/dnd/Mover.js
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojo/dnd/Mover.js
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadsemanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz
semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojo/dnd/Mover.js')
-rw-r--r--includes/js/dojo/dnd/Mover.js84
1 files changed, 0 insertions, 84 deletions
diff --git a/includes/js/dojo/dnd/Mover.js b/includes/js/dojo/dnd/Mover.js
deleted file mode 100644
index 94f84f1..0000000
--- a/includes/js/dojo/dnd/Mover.js
+++ /dev/null
@@ -1,84 +0,0 @@
-if(!dojo._hasResource["dojo.dnd.Mover"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.dnd.Mover"] = true;
-dojo.provide("dojo.dnd.Mover");
-
-dojo.require("dojo.dnd.common");
-dojo.require("dojo.dnd.autoscroll");
-
-dojo.declare("dojo.dnd.Mover", null, {
- constructor: function(node, e, host){
- // summary: an object, which makes a node follow the mouse,
- // used as a default mover, and as a base class for custom movers
- // node: Node: a node (or node's id) to be moved
- // e: Event: a mouse event, which started the move;
- // only pageX and pageY properties are used
- // host: Object?: object which implements the functionality of the move,
- // and defines proper events (onMoveStart and onMoveStop)
- this.node = dojo.byId(node);
- this.marginBox = {l: e.pageX, t: e.pageY};
- this.mouseButton = e.button;
- var h = this.host = host, d = node.ownerDocument,
- firstEvent = dojo.connect(d, "onmousemove", this, "onFirstMove");
- this.events = [
- 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"),
- firstEvent
- ];
- // notify that the move has started
- if(h && h.onMoveStart){
- h.onMoveStart(this);
- }
- },
- // mouse event processors
- onMouseMove: function(e){
- // summary: event processor for onmousemove
- // e: Event: mouse event
- dojo.dnd.autoScroll(e);
- var m = this.marginBox;
- this.host.onMove(this, {l: m.l + e.pageX, t: m.t + e.pageY});
- },
- onMouseUp: function(e){
- if(this.mouseButton == e.button){
- this.destroy();
- }
- },
- // utilities
- onFirstMove: function(){
- // summary: makes the node absolute; it is meant to be called only once
- var s = this.node.style, l, t;
- switch(s.position){
- case "relative":
- case "absolute":
- // assume that left and top values are in pixels already
- l = Math.round(parseFloat(s.left));
- t = Math.round(parseFloat(s.top));
- break;
- default:
- s.position = "absolute"; // enforcing the absolute mode
- var m = dojo.marginBox(this.node);
- l = m.l;
- t = m.t;
- break;
- }
- this.marginBox.l = l - this.marginBox.l;
- this.marginBox.t = t - this.marginBox.t;
- this.host.onFirstMove(this);
- dojo.disconnect(this.events.pop());
- },
- destroy: function(){
- // summary: stops the move, deletes all references, so the object can be garbage-collected
- dojo.forEach(this.events, dojo.disconnect);
- // undo global settings
- var h = this.host;
- if(h && h.onMoveStop){
- h.onMoveStop(this);
- }
- // destroy objects
- this.events = this.node = null;
- }
-});
-
-}