fix drag drop of folders, r=standard8, sr=neil, 456096
authorDavid Bienvenu <bienvenu@nventure.com>
Fri, 26 Sep 2008 16:45:19 -0700
changeset 446 9286d1809f7b2f2aec4941b8236facf5b754ab5d
parent 445 fff1a4dbb400dced6189fbef33f56742816b9495
child 447 c679dd5d36b15b2b43d497f0174ad9ad2dfdec68
push idunknown
push userunknown
push dateunknown
reviewersstandard8, neil, 456096
bugs456096
fix drag drop of folders, r=standard8, sr=neil, 456096
mailnews/base/resources/content/messengerdnd.js
--- a/mailnews/base/resources/content/messengerdnd.js
+++ b/mailnews/base/resources/content/messengerdnd.js
@@ -423,18 +423,30 @@ function BeginDragFolderTree(event)
     { // news folder (newsgroup)
       flavor = "text/x-moz-newsfolder";
     }
     else
     { // normal folder
       flavor = "text/x-moz-folder";
     }
 
-    var selectedFolders = GetSelectedFolders();
-    return BeginDragTree(event, folderTree, selectedFolders, flavor);
+    var folderArray = [];
+    var folderTree = GetFolderTree();
+    var rangeCount = folderTree.view.selection.getRangeCount();
+
+    for (var i = 0; i < rangeCount; i++)
+    {
+      var startIndex = {};
+      var endIndex = {};
+      folderTree.view.selection.getRangeAt(i, startIndex, endIndex);
+      for (var j = startIndex.value; j <= endIndex.value; j++)
+        folderArray.push(GetFolderResource(folderTree, j).Value);
+    }
+
+    return BeginDragTree(event, folderTree, folderArray, flavor);
 }
 
 function BeginDragThreadPane(event)
 {
     debugDump("BeginDragThreadPane\n");
 
     var threadTree = GetThreadTree();
     var selectedMessages = GetSelectedMessages();