commit/galaxy-central: jgoecks: Add generic method for getting track type and use it when saving visualizations.
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/b13d16085dfc/ changeset: b13d16085dfc user: jgoecks date: 2011-06-27 22:58:52 summary: Add generic method for getting track type and use it when saving visualizations. affected #: 2 files (861 bytes) --- a/static/scripts/trackster.js Mon Jun 27 15:44:59 2011 -0400 +++ b/static/scripts/trackster.js Mon Jun 27 16:58:52 2011 -0400 @@ -1524,6 +1524,7 @@ * ----> FeatureTrack * -------> ReadTrack * -------> ToolDataFeatureTrack + * -------> VcfTrack */ var Track = function(name, view, parent_element, data_url, data_query_wait) { // @@ -1556,6 +1557,32 @@ this.parent_element.append(this.container_div); }; extend(Track.prototype, { + /** Returns track type. */ + get_type: function() { + // Order is important: start with most-specific classes and go up the track hierarchy. + if (this instanceof LabelTrack) { + return "LabelTrack"; + } + else if (this instanceof ReferenceTrack) { + return "ReferenceTrack"; + } + else if (this instanceof LineTrack) { + return "LineTrack"; + } + else if (this instanceof ReadTrack) { + return "ReadTrack"; + } + else if (this instanceof ToolDataFeatureTrack) { + return "ToolDataFeatureTrack"; + } + else if (this instanceof VcfTrack) { + return "VcfTrack"; + } + else if (this instanceof FeatureTrack) { + return "FeatureTrack"; + } + return ""; + }, /** * Initialize and draw the track. */ --- a/templates/tracks/browser.mako Mon Jun 27 15:44:59 2011 -0400 +++ b/templates/tracks/browser.mako Mon Jun 27 16:58:52 2011 -0400 @@ -59,8 +59,7 @@ converted_datasets_state_url = "${h.url_for( action='converted_datasets_state' )}", addable_track_types = { "LineTrack": LineTrack, "FeatureTrack": FeatureTrack, "ReadTrack": ReadTrack }, view; - - + /** * Add bookmark. */ @@ -85,7 +84,7 @@ view.has_changes = true; return new_bookmark; - } + }; $(function() { // Hide bookmarks by default right now. @@ -267,7 +266,7 @@ // Add track. tracks.push( { - "track_type": track.track_type, + "track_type": track.get_type(), "name": track.name, "hda_ldda": track.hda_ldda, "dataset_id": track.dataset_id, 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