09e400d2462f71364f27044aa63bf1f38b022277
hiram
  Tue Jan 31 11:19:09 2012 -0800
different location to avoid duplicate html page for custom track bedDetail
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index d7fb4af..ebe6140 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -20099,32 +20099,30 @@
 	    {
 	    for (bed = ct->bedList; bed != NULL; bed = bed->next)
 		if (bed->chromStart == start && sameString(seqName, bed->chrom))
 		    if (bed->name == NULL || sameString(itemName, bed->name) )
 			break;
 	    }
 	}
     if (bed == NULL)
 	errAbort("Couldn't find %s@%s:%d in %s", itemName, seqName,
 		start, fileName);
     printCustomUrl(ct->tdb, itemName, TRUE);
     bedPrintPos(bed, ct->fieldCount, NULL);
     }
 printTrackUiLink(ct->tdb);
 printUpdateTime(CUSTOM_TRASH, ct->tdb, ct);
-/* already done in doBedDetail */
-if (differentWord(type, "bedDetail"))
     printTrackHtml(ct->tdb);
 }
 
 void blastProtein(struct trackDb *tdb, char *itemName)
 /* Show protein to translated dna alignment for accession. */
 {
 char startBuf[64], endBuf[64];
 int start = cartInt(cart, "o");
 boolean isClicked;
 struct psl *psl = 0;
 struct sqlResult *sr = NULL;
 struct sqlConnection *conn = hAllocConn(database);
 char query[256], **row;
 struct psl* pslList = getAlignments(conn, tdb->table, itemName);
 char *useName = itemName;
@@ -23782,30 +23780,32 @@
       "select * from %s where chrom = '%s' and chromStart = %d and chromEnd = %d and name = '%s'", table, chrom, start, end, escName);
 sr = sqlGetResult(conn, query);
 if ((row = sqlNextRow(sr)) != NULL)
     {
     r = bedDetailLoadWithGaps(row, bedPart+2);
     bedPrintPos((struct bed*)r, bedPart, tdb);
     if (r->id != NULL)
         {
         printf("<B>ID:</B> %s <BR>\n", r->id);
         printCustomUrl(tdb, r->id, TRUE);
         }
     if (r->description != NULL)
         printf("%s <BR>\n", r->description);
     }
 sqlFreeResult(&sr);
+/* do not print this for custom tracks, they do this later */
+if (ct == NULL)
 printTrackHtml(tdb);
 
 bedDetailFree(&r);
 freeMem(escName);
 hFreeConn(&conn);
 }
 
 struct trackDb *tdbForTableArg()
 /* get trackDb for track passed in table arg */
 {
 char *table = cartString(cart, "table");
 struct trackDb *tdb = hashFindVal(trackHash, table);
 if (tdb == NULL)
     errAbort("no trackDb entry for %s", table);
 return tdb;