2eecd47992bf6fcfee294854359117d81167459a max Sat Sep 5 15:51:03 2026 -0700 hgc: show the trackDb iframeUrl frame with the item details, not above them The iframe from the iframeUrl setting was written out before anything else on the details page, which is unlike every other part of a details page. It now appears just below the "View DNA for this feature" line, with the rest of the details. Rather than move each of the printIframe() calls, which all happen before the position is known, printIframe() now only builds the html and a new printPendingIframe() writes it out from the position-printing routines. That covers bigBed, bigPsl and the generic click handler alike. The lorax details page prints it immediately, since there the iframe is the page itself. Also, a track with an iframeUrl but no url setting never showed its iframe at all, refs #37595 diff --git src/hg/hgc/loraxClick.c src/hg/hgc/loraxClick.c index 5017e5bdb9f..07c809026ef 100644 --- src/hg/hgc/loraxClick.c +++ src/hg/hgc/loraxClick.c @@ -1,34 +1,36 @@ /* Details page for Lorax multi-tree viewer track type */ /* Copyright (C) 2025 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #include "common.h" #include "cart.h" #include "cheapcgi.h" #include "hgc.h" #include "jsHelper.h" void doLorax(struct trackDb *tdb, char *item) /* Display the Lorax multi-tree viewer. */ { // Open page and get parameters from CGI cartWebStart(cart, database, "%s: %s", genome, tdb->longLabel); char *chrom = cartString(cart, "c"); int start = cartInt(cart, "o"); int end = cartInt(cart, "t"); -// Print iframe (using tdb settings iframeUrl and iframeOptions) +// Print iframe (using tdb settings iframeUrl and iframeOptions). The iframe is the +// content of this page, not a detail of an item, so print it right here. printIframe(tdb, ""); +printPendingIframe(); // jsIncludeFile throws an error due to CSP when invoked via pop-up, but is necessary when // "Enable pop-up when clicking items" is disabled in Genome Browser. // When invoked via pop-up, hgTracks has already included lorax.js, so the error can be // ignored because the file has already been loaded. jsIncludeFile("lorax.js", NULL); // jsInline still works in pop-up mode even though jsIncludeFile doesn't. (ASH has no idea why.) jsInlineF("loraxView('%s', %d, %d, %d, %d);", chrom, winStart, winEnd, start, end); printTrackHtml(tdb); }