81842c2165adae48ce9f3d56c5838f78f32d3168
braney
  Mon Oct 16 15:08:20 2017 -0700
expand nodes when something is dropped on them.   Fix mouseover for "GO"
button.   Don't show scroll bars unless necessary

diff --git src/hg/js/hgCollection.js src/hg/js/hgCollection.js
index a340881..2adac65 100644
--- src/hg/js/hgCollection.js
+++ src/hg/js/hgCollection.js
@@ -143,30 +143,33 @@
 
         $('#collectionList').append("<li " + attributes +  "id='"+ourCollectionName+"'>A New Collection</li>");
         $('#currentCollection').append("<div id='"+ourTreeName+"'><ul><li data-jstree='{\"icon\":\"../images/folderC.png\"}' " + attributes+ ">A New Collection</li><ul></div>");
         var newTree = $('#currentCollection div:last');
         trees[ourCollectionName] = newTree;
         $(newTree).jstree({
                "core" : {
                      "check_callback" : checkCallback
                          },
                'plugins' : ['dnd', 'conditionalselect', 'contextmenu'],
                'check_callback' : checkCallback,
                'contextmenu': { "items" : currentCollectionItems},
                'dnd': {check_while_dragging: true}
         });
         $(newTree).on("select_node.jstree", selectTreeNode);
+        $(newTree).on("copy_node.jstree", function (evt, data)  {
+            $(evt.target).jstree("toggle_node", data.parent);
+        });
         var lastElement = $("#collectionList li").last();
         //lastElement.addClass("folder");
         selectElements($("#collectionList"), lastElement) ;
         rebuildLabel();
     }
 
     function hideAllTrees() {
         // hide all the trees in the Collected Tracks window
         for(var key in trees)
             trees[key].hide();
     }
 
     function selectCollection(event, ui ) {
         // called with a collection is selected
         var id = ui.selected.id;
@@ -349,30 +352,33 @@
         $.jstree.defaults.core.themes.dots = true;
         $.jstree.defaults.contextmenu.show_at_node = false;
         $("#currentCollection div").each(function(index) {
             var newTree = this;
 
             $(newTree).jstree({
                'plugins' : ['dnd', 'conditionalselect', 'contextmenu'],
                'contextmenu': { "items" : currentCollectionItems},
                'dnd': {
                 "check_callback" : checkCallback,
                 }
             });
             recordNames(newTree);
             trees[this.id] = $(newTree);
             $(newTree).on("select_node.jstree", selectTreeNode);
+            $(newTree).on("copy_node.jstree", function (evt, data)  {
+                $(evt.target).jstree("toggle_node", data.parent);
+            });
         });
 
         treeDiv=$('#tracks');
         treeDiv.jstree({
                'plugins' : ['dnd', 'conditionalselect', 'contextmenu'],
                'contextmenu': { "items" : currentTrackItems},
                'dnd': {
                 "check_callback" : checkCallback,
                'always_copy' : true,
                 is_draggable: isDraggable,
                },
                'core' :  {
                 "check_callback" : checkCallback
             }
         });