5199438a1019eff8b60a3f9bc404b6494ed800c2
braney
  Tue May 9 07:41:33 2017 -0700
Add menus to do sorting on custom composites.

diff --git src/hg/hgTracks/imageV2.c src/hg/hgTracks/imageV2.c
index 56bde44..3f85fdc 100644
--- src/hg/hgTracks/imageV2.c
+++ src/hg/hgTracks/imageV2.c
@@ -2,30 +2,31 @@
 
 /* Copyright (C) 2014 The Regents of the University of California 
  * See README in this or parent directory for licensing information. */
 #include "common.h"
 #include "hPrint.h"
 #include "chromInfo.h"
 #include "hdb.h"
 #include "hui.h"
 #include "jsHelper.h"
 #include "cheapcgi.h"
 #include "htmshell.h"
 #include "imageV2.h"
 #include "hgTracks.h"
 #include "hgConfig.h"
 #include "regexHelper.h"
+#include "customComposite.h"
 
 // Note: when right-click View image (or pdf output) then theImgBox==NULL, so it will be rendered as a single simple image
 struct imgBox   *theImgBox   = NULL; // Make this global for now to avoid huge rewrite
 struct imgTrack *curImgTrack = NULL; // Make this global for now to avoid huge rewrite
 
 /////////////////////////
 // FLAT TRACKS
 // A simplistic way of flattening the track list before building the image
 // NOTE: Strategy is NOT to use imgBox->imgTracks, since this should be independednt of imageV2
 /////////////////////////
 void flatTracksAdd(struct flatTracks **flatTracks,struct track *track,struct cart *cart)
 // Adds one track into the flatTracks list
 {
 struct flatTracks *flatTrack;
 AllocVar(flatTrack);
@@ -228,30 +229,32 @@
 
 // Tell something about the parent and/or children
 if (kindOfChild != kocOrphan)
     {
     struct trackDb *parentTdb = (kindOfChild == kocFolderContent ? track->tdb->parent
                                                                  : tdbGetContainer(track->tdb));
     jsonObjectAdd(ele, "parentTrack", newJsonString(parentTdb->track));
     jsonObjectAdd(ele, "parentLabel", newJsonString(parentTdb->shortLabel));
     if (kindOfChild != kocFolderContent && !track->canPack)
         {
         jsonObjectAdd(ele, "shouldPack", newJsonNumber(0)); // default vis is full,
         track->canPack = rTdbTreeCanPack(parentTdb);        // but pack is an option
         }
     }
 
+boolean isCustomComposite = trackDbSettingOn(track->tdb, CUSTOM_COMPOSITE_SETTING);
+jsonObjectAdd(ele, "isCustomComposite", newJsonBoolean(isCustomComposite));
 // XXXX really s/d be numChildren
 jsonObjectAdd(ele, "hasChildren", newJsonNumber(slCount(track->tdb->subtracks)));
 
 // Configuring?
 int cfgByPopup = configurableByAjax(track->tdb,0);
 if (!configurable
 ||  track->hasUi == FALSE
 ||  cfgByPopup == cfgNone)
     jsonObjectAdd(ele, "configureBy", newJsonString("none"));
 else if (cfgByPopup < 0)  // denied via ajax, but allowed via full normal hgTrackUi page
     jsonObjectAdd(ele, "configureBy", newJsonString("clickThrough"));
 else
     jsonObjectAdd(ele, "configureBy", newJsonString("popup"));
 
 // Remote access by URL?