Opened 15 years ago
Closed 15 years ago
#4945 closed defect (wontfix)
Drop n Drop error in TreeV3 - dojo.html.getAbsolutePosition
Reported by: | guest | Owned by: | Adam Peller |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | DnD | Version: | 0.4.2rc1 |
Keywords: | dnd drag and drop treev3 | Cc: | [email protected]… |
Blocked By: | Blocking: |
Description
The situation looks like that : I have two trees ,call them A and B, generaly dragging and droping works fine till some specific moment. Tree A is rather large (about 804 nodes). I find that whenever I go into some nodes drag and drop stops working. I have digg in the code and I found out that the problem lies in the TreeDragAndDropV3.js file along with layout.js . The TreeDrag?... file contains a function getPosition which as I believe counts if the mouse cursor is on , before or after the node. To compute it it use cached values of Y coordinate.
cacheNodeCoords: function() {
var node = this.treeNode.contentNode;
this.cachedNodeY = dojo.html.getAbsolutePosition(node).y; this.cachedNodeHeight = dojo.html.getBorderBox(node).height;
},
I have noticed that getAbsolutePosition() returns sometimes strange results. While let say it normaly returs 700 on the node I was testing it start to returns values about 470-500 when I've notice an error. Diging into getAbsolute... method I have noticed try{
var bo = document.getBoxObjectFor(node); ret.x = bo.x - dojo.html.sumAncestorProperties(node, scrollLeft"); ret.y = bo.y - dojo.html.sumAncestorProperties(node, scrollTop");
}catch(e){
squelch
}
(btw isn't it dangerous to leave empty catch? ). Generaly when DnD works fine sumAncestorProperties() returns zero but when error take place it starts counting some elements and returns values around 200-400. This was the result of my problem. Whenever I drag over a target tree I get a pointer that I was 'after' the node even when I was clearly 'onto' becouse sumAnchestorProperties sum other elements and couse getPosition point to 'after' of the node. I was trying to debug it but my firefox start crushing when I was displaying node.innerHTML inside sumAncestorProperties. I have manage ,somehow , to find out that it starts counting whole page elements (even this not connected to the tree).
Browser : FireFox? , IE , Safarii OS : M$ Windows XP (unfortunately)
if need any more details I am available under mkruszyk[sign]gmail[dot]com
Change History (2)
comment:1 Changed 15 years ago by
Owner: | changed from Eugene Lazutkin to Adam Peller |
---|
comment:2 Changed 15 years ago by
Milestone: | → 1.0 |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
I haven't noticed this problem in 1.0, and since everything has been rewritten for 1.0 I assume this is no longer an issue. Sorry we never got around to fixing it in 0.4. Please open a new bug if this is still an issue in 1.0.
I don't know what to do about this ticket --- it is for 0.4.2rc1. I am bouncing it to Adam so he will assign somebody more knowledgeable.