commit/galaxy-central: jgoecks: Trackster: only query feature tracks for feature locations.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/15329256872b/ Changeset: 15329256872b User: jgoecks Date: 2013-05-03 16:52:11 Summary: Trackster: only query feature tracks for feature locations. Affected #: 1 file diff -r cf2db2f91c7f4ca284daea800aa9596c27ff809b -r 15329256872bf03a3831bc5e3a970cbe8611a3fe static/scripts/viz/trackster/tracks.js --- a/static/scripts/viz/trackster/tracks.js +++ b/static/scripts/viz/trackster/tracks.js @@ -438,6 +438,7 @@ this.obj_type = obj_dict.obj_type; this.drawables = []; }; + extend(DrawableCollection.prototype, Drawable.prototype, { /** * Unpack and add drawables to the collection. @@ -560,6 +561,26 @@ */ get_drawables: function() { return this.drawables; + }, + + /** + * Returns all <track_type> tracks in collection. + */ + get_tracks: function(track_type) { + // Initialize queue with copy of drawables array. + var queue = this.drawables.slice(0), + tracks = [], + drawable; + while (queue.length !== 0) { + drawable = queue.shift(); + if (drawable instanceof track_type) { + tracks.push(drawable); + } + else if (drawable.drawables) { + queue = queue.concat(drawable.drawables); + } + } + return tracks; } }); @@ -967,8 +988,8 @@ source: function(request, response) { // Using current text, query each track and create list of all matching features. var all_features = [], - feature_search_deferreds = $.map(view.get_drawables(), function(drawable) { - return drawable.data_manager.search_features(request.term).success(function(dataset_features) { + feature_search_deferreds = $.map(view.get_tracks(FeatureTrack), function(t) { + return t.data_manager.search_features(request.term).success(function(dataset_features) { all_features = all_features.concat(dataset_features); }); }); 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