[2] | 1 | <%inherit file="/display_base.mako"/> |
---|
| 2 | |
---|
| 3 | <%def name="javascripts()"> |
---|
| 4 | <% config = item_data %> |
---|
| 5 | ${parent.javascripts()} |
---|
| 6 | ${h.js( "jquery.event.drag", "jquery.autocomplete", "jquery.mousewheel", "trackster" )} |
---|
| 7 | |
---|
| 8 | <script type="text/javascript"> |
---|
| 9 | var view; |
---|
| 10 | // To adjust the size of the viewport to fit the fixed-height footer |
---|
| 11 | var refresh = function( e ) { |
---|
| 12 | if (view !== undefined) { |
---|
| 13 | view.viewport_container.height( $("#center").height() - $(".nav-container").height() - 40 ); |
---|
| 14 | view.nav_container.width( $("#center").width() ); |
---|
| 15 | view.redraw(); |
---|
| 16 | } |
---|
| 17 | }; |
---|
| 18 | $(window).bind( "resize", function(e) { refresh(e); } ); |
---|
| 19 | $("#right-border").bind( "click dragend", function(e) { refresh(e); } ); |
---|
| 20 | $(window).trigger( "resize" ); |
---|
| 21 | </script> |
---|
| 22 | |
---|
| 23 | </%def> |
---|
| 24 | |
---|
| 25 | <%def name="stylesheets()"> |
---|
| 26 | ${parent.stylesheets()} |
---|
| 27 | |
---|
| 28 | <style type="text/css"> |
---|
| 29 | .nav-container { |
---|
| 30 | position: fixed; |
---|
| 31 | width: 100%; |
---|
| 32 | left: 0; |
---|
| 33 | bottom: 0; |
---|
| 34 | } |
---|
| 35 | .page-body { |
---|
| 36 | padding: 0px; |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | </style> |
---|
| 40 | </%def> |
---|
| 41 | |
---|
| 42 | <%def name="render_item_header( item )"> |
---|
| 43 | ## Don't need to show header |
---|
| 44 | </%def> |
---|
| 45 | |
---|
| 46 | <%def name="render_item_links( visualization )"> |
---|
| 47 | |
---|
| 48 | </%def> |
---|
| 49 | |
---|
| 50 | <%def name="render_item( visualization, config )"> |
---|
| 51 | <div id="${visualization.id}"></div> |
---|
| 52 | |
---|
| 53 | <script type="text/javascript"> |
---|
| 54 | |
---|
| 55 | var data_url = "${h.url_for( controller='/tracks', action='data' )}", |
---|
| 56 | reference_url = "${h.url_for( controller='/tracks', action='reference' )}", |
---|
| 57 | chrom_url = "${h.url_for( controller='/tracks', action='chroms' )}", |
---|
| 58 | view; |
---|
| 59 | |
---|
| 60 | var container_element = $("#${visualization.id}"); |
---|
| 61 | view = new View( container_element, "${config.get('chrom')}", "${config.get('title') | h}", "${config.get('vis_id')}", "${config.get('dbkey')}" ); |
---|
| 62 | %for track in config.get('tracks'): |
---|
| 63 | view.add_track( |
---|
| 64 | new ${track["track_type"]}( "${track['name'] | h}", view, ${track['dataset_id']}, ${track['prefs']} ) |
---|
| 65 | ); |
---|
| 66 | %endfor |
---|
| 67 | container_element.parents(".item-content").css( { "max-height": "none", "overflow": "visible" } ); |
---|
| 68 | |
---|
| 69 | </script> |
---|
| 70 | </%def> |
---|