1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/7e383f2a3e6f/ changeset: r5282:7e383f2a3e6f user: jgoecks date: 2011-03-29 22:27:35 summary: Trackster: simplify use of jQuery deferreds for getting data. affected #: 1 file (448 bytes) --- a/static/scripts/trackster.js Tue Mar 29 14:28:17 2011 -0400 +++ b/static/scripts/trackster.js Tue Mar 29 16:27:35 2011 -0400 @@ -1071,6 +1071,15 @@ }); /** + * Tiles for TiledTracks. + */ +var Tile = function(track, canvas, histo_max) { + this.track = track; + this.canvas = canvas; + this.histo_max = histo_max; +}; + +/** * Tracks are objects can be added to the View. * * Track object hierarchy: @@ -1113,7 +1122,7 @@ this.content_div = $("<div class='track-content'>").appendTo(this.container_div); this.parent_element.append(this.container_div); }; -$.extend( Track.prototype, { +$.extend(Track.prototype, { /** * Initialize and draw the track. */ @@ -1476,7 +1485,7 @@ } */ }; -$.extend( TiledTrack.prototype, Track.prototype, { +$.extend(TiledTrack.prototype, Track.prototype, { /** * Make popup menu for track name. */ @@ -1732,23 +1741,17 @@ // Really draw tile: get data, seq data if available, and draw tile. // $.when(track.data_cache.get_data(view.chrom, tile_low, tile_high, track.mode, - resolution, track.data_url_extra_params)).then(function() { - // Data available for track. - var result = track.data_cache.get_data(view.chrom, tile_low, tile_high, track.mode, - resolution, track.data_url_extra_params); + resolution, track.data_url_extra_params)).then(function(tile_data) { // If sequence data needed, get that and draw. Otherwise draw. if (view.reference_track && w_scale > CHAR_WIDTH_PX) { $.when(view.reference_track.data_cache.get_data(view.chrom, tile_low, tile_high, track.mode, resolution, - view.reference_track.data_url_extra_params)).then(function() { - var seq_data = view.reference_track.data_cache.get_data(view.chrom, tile_low, tile_high, - track.mode, resolution, - view.reference_track.data_url_extra_params); - draw_and_show_tile(id, result, resolution, tile_index, parent_element, w_scale, seq_data); + view.reference_track.data_url_extra_params)).then(function(seq_data) { + draw_and_show_tile(id, tile_data, resolution, tile_index, parent_element, w_scale, seq_data); }); } else { - draw_and_show_tile(id, result, resolution, tile_index, parent_element, w_scale); + draw_and_show_tile(id, tile_data, resolution, tile_index, parent_element, w_scale); } }); } 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.