commit/galaxy-central: carlfeberhard: fix to apply tooltips to running/queued datasets in history panel
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/5cdb0038c89d/ changeset: 5cdb0038c89d user: carlfeberhard date: 2012-09-18 18:39:13 summary: fix to apply tooltips to running/queued datasets in history panel affected #: 1 file diff -r 069768b7833ebae78f1c7c7aa97904627540ac3a -r 5cdb0038c89d1396755b2c7e371bde63b221b8df templates/root/history.mako --- a/templates/root/history.mako +++ b/templates/root/history.mako @@ -116,6 +116,43 @@ }); }; +// ----------------------------------------------------------------------------- +function applyTooltip( elem ){ + // apply twitter bootstrap tooltip to elem + + //!! 2 line tooltips placed above do not render properly + //TODO: hack (github has an issue on this - see how it's resolved) + var $this = $( elem ); + if( $this.hasClass( 'tooltip' ) ){ + + // remove original tooltip + if( $this.attr( 'data-original-title' ) ){ + // documented method - that doesn't seem to work + //$( this ).tooltip( 'destroy' ); + $this.data( 'tooltip', false ); + + // swap title back + var title = $this.attr( 'data-original-title' ); + $this.attr( 'data-original-title', null ); + $this.attr( 'title', title ); + } + + // (re-)apply tooltip + // place them on the bottom for now + $this.tooltip({ placement : 'bottom' }); + } + return this; +} + +function applyTooltips( elem ){ + // apply twitter bootstrap tooltips to this element and all children + $( $( elem ).find( '.tooltip' ).andSelf() ).each( function(){ + applyTooltip( this ); + }); + return this; +} + +// ----------------------------------------------------------------------------- // Create trackster action function. function create_trackster_action_fn(vis_url, dataset_params, dbkey) { return function() { @@ -327,24 +364,7 @@ tag_handling(this); annotation_handling(this); - - //TODO: hack (github has an issue on this - see how it's resolved) - // fix for two line bootstrap tooltips when placement: above - $( this ).find( '.tooltip' ).each( function(){ - var $this = $( this ); - - // documented method - that doesn't seem to work - //$( this ).tooltip( 'destroy' ); - - $this.data( 'tooltip', false ); - var title = $this.attr( 'data-original-title' ); - $this.attr( 'data-original-title', null ); - $this.attr( 'title', title ); - - // place them on the bottom for now - $this.tooltip({ placement : 'bottom' }); - }); - + applyTooltips( this ); }); _.each( $(".visualize-icon"), function(icon) { @@ -469,8 +489,12 @@ var container = $("#historyItemContainer-" + id); container.html( val.html ); init_history_items( $("div.historyItemWrapper"), "noinit" ); + + // apply ui element behaviors tag_handling(container); annotation_handling(container); + applyTooltips( container ); + var viz_icon = container.find(".visualize-icon")[0]; if (viz_icon) { init_viz_icon(viz_icon); } @@ -674,4 +698,4 @@ </div></body> -</html> +</html> \ No newline at end of file Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket