Author: jablko
Date: Thu Oct  8 13:49:46 2009
New Revision: 3695

Log:
Using closure for dragged node fails because JavaScript loops aren't new 
scopes, so dragged node variable will always be value after loops, or the last 
of the node's siblings. Use .getNodeByElement() instead.

Modified:
   trunk/web/js/treeView.js

Modified: trunk/web/js/treeView.js
==============================================================================
--- trunk/web/js/treeView.js    Thu Oct  8 13:41:56 2009        (r3694)
+++ trunk/web/js/treeView.js    Thu Oct  8 13:49:46 2009        (r3695)
@@ -24,6 +24,8 @@
 
             dd.onDragDrop = function (event, id)
               {
+                var textNode = parentNode.tree.getNodeByElement(this.getEl());
+
                 var newParent = parentNode.tree.getNodeByElement($('#' + 
id)[0]);
 
                 jQuery.ajax({
@@ -105,6 +107,8 @@
 
                   dd.onDragDrop = function (event, id)
                     {
+                      var textNode = 
parentNode.tree.getNodeByElement(this.getEl());
+
                       var newParent = node.tree.getNodeByElement($('#' + 
id)[0]);
 
                       jQuery.ajax({

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to