f78979b24262249568579f0f50edb0451745c2d7
braney
  Tue Aug 15 17:36:03 2017 -0700
mostly hooked up attribute setting.   Some hooks to get drag and drop to
be more selective about where you can drag and drop.

diff --git src/hg/hgCollection/hgCollection.c src/hg/hgCollection/hgCollection.c
index 8bcf6b5..a610281 100644
--- src/hg/hgCollection/hgCollection.c
+++ src/hg/hgCollection/hgCollection.c
@@ -96,38 +96,47 @@
 return NULL;
 }
 
 static boolean trackCanBeAdded(struct trackDb *tdb)
 // are we allowing this track into a custom composite
 {
 return  (tdb->subtracks == NULL) && !startsWith("wigMaf",tdb->type) &&  (startsWith("wig",tdb->type) || startsWith("bigWig",tdb->type)) ;
 }
 
 static void printGroup(char *parent, struct trackDb *tdb, boolean folder, boolean user)
 // output list elements for a group
 {
 char *userString = "";
 char *prefix = "";
 
-//if (user)
+if (user)
     {
     //prefix = "coll_";
     if (tdb->parent && tdb->subtracks) 
         userString = "viewType='view'";
     else
         userString = "viewType='track'";
     }
+else
+    {
+    //prefix = "coll_";
+    if (tdb->parent && tdb->subtracks) 
+        userString = "class='nodrop' viewType='view'";
+    else
+        userString = "class='nodrop' viewType='track'";
+    }
+    
         //userString = "viewType='track data-jstree='{'icon':'images/folderC.png'}''";
     
 #define IMAKECOLOR_32(r,g,b) ( ((unsigned int)b<<0) | ((unsigned int)g << 8) | ((unsigned int)r << 16))
 
 jsInlineF("<li shortLabel='%s' longLabel='%s' color='#%06x' visibility='%s'  name='%s%s' %s><span class='%s'>%s</span>",  tdb->shortLabel, tdb->longLabel,IMAKECOLOR_32(tdb->colorR,tdb->colorG,tdb->colorB), hStringFromTv(tdb->visibility), prefix,  trackHubSkipHubName(tdb->track),   userString, folder ? "folder" : "file", tdb->shortLabel );
 jsInlineF("%s", tdb->longLabel);
 
 
 if (tdb->subtracks)
     {
     struct trackDb *subTdb;
 
     jsInlineF("<ul>");
     for(subTdb = tdb->subtracks; subTdb; subTdb = subTdb->next)
         printGroup(trackHubSkipHubName(tdb->track), subTdb, user && (subTdb->subtracks != NULL), user);
@@ -245,31 +254,31 @@
 
 void doTable()
 // output the tree table
 {
 char *hubName = hubNameFromUrl(getHubName(database));
 struct grp *curGroup;
 for(curGroup = fullGroupList; curGroup;  curGroup = curGroup->next)
     {
     if ((hubName != NULL) && sameString(curGroup->name, hubName))
         break;
     }
 if (curGroup != NULL)
     {
     // print out all the tracks in this group
     struct trackDb *tdb;
-    jsInlineF("$('#startCollections').append(\"");
+    jsInlineF("$('#collection').append(\"");
     for(tdb = fullTrackList; tdb;  tdb = tdb->next)
         {
         if (sameString(tdb->grp, hubName))
             {
             //jsInlineF("<li name='%s'><span class='file'>%s</span></li>", tdb->track, tdb->shortLabel);
             jsInlineF("<div id='%s' shortLabel='%s'>", trackHubSkipHubName(tdb->track), tdb->shortLabel);
             jsInlineF("<ul>");
             printGroup("collections", tdb, TRUE, TRUE);
             jsInlineF("<ul>");
             jsInlineF("</div>");
             }
         }
     jsInlineF("\");\n");
     
     // print out all the tracks in this group