Update of
/var/cvs/contributions/CMSContainer/cmsc/utilities/src/webapp/editors/utils/ajaxtree
In directory james.mmbase.org:/tmp/cvs-serv31455
Modified Files:
ajaxtree.js
Log Message:
CMSC-1078 Drag and drop can mess up the site tree (visually)
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/utilities/src/webapp/editors/utils/ajaxtree
See also: http://www.mmbase.org/jira/browse/CMSC-1078
Index: ajaxtree.js
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer/cmsc/utilities/src/webapp/editors/utils/ajaxtree/ajaxtree.js,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- ajaxtree.js 21 Aug 2008 06:54:20 -0000 1.9
+++ ajaxtree.js 17 Oct 2008 11:37:21 -0000 1.10
@@ -93,7 +93,13 @@
},
makeDraggable : function (oItem){
if(!oItem) return;
+ //if document.onmousedown is not null, it means that oItem is
copyObject but not
+ //dargObject. Then do nothing and return
+ if(document.onmousedown) return;
document.onmousedown = function(ev){
+ //if document.onmouseup is not null, it means that
document.onmousedown has not
+ //been destroyed.If you down another mouse button here, it
should do nothing and return
+ if(document.onmouseup) return;
document.onmousemove = alldragObject.mouseMove(ev);
document.onmouseup = alldragObject.mouseUp(ev);
oItem.onclick = ajaxTreeHandler.isclick;
@@ -1051,8 +1057,8 @@
mouseAction.prototype.mouseCoords = function (ev){
- if(ev.clientX || ev.clientY){
- return {x:ev.clientX, y:ev.clientY};
+ if(ev.pageX || ev.pageY){
+ return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft -
document.body.clientLeft,
@@ -1107,6 +1113,8 @@
alldragObject.dragObject = null;
alldragObject.iMouseDown = false;
document.onmousemove = null;
+ document.onmouseup = null;
+ document.onmousedown = null;
alldragObject.copyObject.style.display = 'none';
alldragObject.pastenode();
alldragObject.insertitem = null;
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs