commit/galaxy-central: jgoecks: Trackster: cleanup and better efficiency for 0932660.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/feecd55a179e/ Changeset: feecd55a179e User: jgoecks Date: 2014-07-06 17:55:03 Summary: Trackster: cleanup and better efficiency for 0932660. Affected #: 1 file diff -r 4139740da48e24d96a475da67613be92fbdba478 -r feecd55a179edf7c9c8021110aa125f1854bef2d static/scripts/viz/trackster/tracks.js --- a/static/scripts/viz/trackster/tracks.js +++ b/static/scripts/viz/trackster/tracks.js @@ -2952,12 +2952,6 @@ * drawn/fetched and shown. */ postdraw_actions: function(tiles, width, w_scale, clear_after) { - // If reference track is visible, adjust viewport to be smaller so that bottom content - // is visible. - if (this.view.reference_track.tiles_div.is(':visible')) { - this.view.resize_viewport(); - } - var line_track_tiles = _.filter(tiles, function(tile) { return (tile instanceof LineTrackTile); }); @@ -3639,14 +3633,30 @@ * Draws and shows tile if reference data can be displayed; otherwise track is hidden. */ draw_helper: function(region, w_scale, options) { + var cur_visible = this.tiles_div.is(':visible'), + new_visible, + tile = null; if (w_scale > this.view.canvas_manager.char_width_px) { this.tiles_div.show(); - return TiledTrack.prototype.draw_helper.call(this, region, w_scale, options); + new_visible = true; + tile = TiledTrack.prototype.draw_helper.call(this, region, w_scale, options); } else { + new_visible = false; this.tiles_div.hide(); - return null; } + + // NOTE: viewport resizing conceptually belongs in postdraw_actions(), but currently + // postdraw_actions is not called when reference track not shown due to no tiles. If + // it is moved to postdraw_actions, resize must be called each time because cannot + // easily detect showing/hiding. + + // If showing or hiding reference track, resize viewport. + if (cur_visible !== new_visible) { + this.view.resize_viewport(); + } + + return tile; }, can_subset: function(entry) { return true; }, 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)
-
commits-noreply@bitbucket.org