Author: sevein
Date: Tue Oct 13 15:11:49 2009
New Revision: 3733

Log:
Use onDragOver and onDragOut functions for hilight nodes when doing drag&drop. 
currentTextNode is set as hilight() for it recognition in the future.

Modified:
   trunk/web/js/treeView.js

Modified: trunk/web/js/treeView.js
==============================================================================
--- trunk/web/js/treeView.js    Tue Oct 13 12:05:56 2009        (r3732)
+++ trunk/web/js/treeView.js    Tue Oct 13 15:11:49 2009        (r3733)
@@ -16,6 +16,11 @@
           textNode.isLeaf = object.isLeaf;
           textNode.qubit_id = object.id;
 
+          if (object.style == 'ygtvlabel currentTextNode')
+          {
+            textNode.highlight();
+          }
+
           if (Qubit.treeView.draggable && !textNode.parent.isRoot())
           {
             var dd = new YAHOO.util.DDProxy(textNode.labelElId);
@@ -28,6 +33,11 @@
 
                 var newParent = parentNode.tree.getNodeByElement($('#' + 
id)[0]);
 
+                if (parentNode.contentElId == newParent.contentElId)
+                {
+                  return false;
+                }
+
                 jQuery.ajax({
                   data: { parent: newParent.qubit_id },
                   type: 'POST',
@@ -75,6 +85,21 @@
                       dd.invalidHandleTypes = {};
                     });
                 }
+
+                if (textNode.highlightState > 0)
+                {
+                  // TODO: expand parent nodes to avoid getting hidden
+                }
+              };
+
+            dd.onDragOver = function (e, id)
+              {
+                $('#' + id).css('font-weight', 'bold');
+              };
+
+            dd.onDragOut = function (e, id)
+              {
+                $('#' + id).css('font-weight', 'normal');
               };
 
             dd.endDrag = function ()
@@ -123,6 +148,11 @@
 
                       var newParent = node.tree.getNodeByElement($('#' + 
id)[0]);
 
+                      if (newParent.contentElId == node.contentElId)
+                      {
+                        return false;
+                      }
+
                       jQuery.ajax({
                         data: { parent: newParent.qubit_id },
                         type: 'POST',
@@ -170,6 +200,21 @@
                             dd.invalidHandleTypes = {};
                           });
                       }
+
+                      if (textNode.highlightState > 0)
+                      {
+                        // TODO: expand parent nodes to avoid getting hidden
+                      }
+                    };
+
+                  dd.onDragOver = function (e, id)
+                    {
+                      $('#' + id).css('font-weight', 'bold');
+                    };
+
+                  dd.onDragOut = function (e, id)
+                    {
+                      $('#' + id).css('font-weight', 'normal');
                     };
 
                   dd.endDrag = function ()

--~--~---------~--~----~------------~-------~--~----~
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