1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/c6416712537b/ changeset: c6416712537b user: jgoecks date: 2011-09-03 00:32:13 summary: Trackster: simplify track iteration during save. affected #: 1 file (292 bytes) --- a/templates/tracks/browser.mako Fri Sep 02 18:00:16 2011 -0400 +++ b/templates/tracks/browser.mako Fri Sep 02 18:32:13 2011 -0400 @@ -204,32 +204,25 @@ "Save": function() { // Show saving dialog box show_modal("Saving...", "<img src='${h.url_for('/static/images/yui/rel_interstitial_loading.gif')}'/>"); + + // TODO: make save into its own function. // Save tracks. - var tracks = []; - $(".viewport-container .track").each(function () { - // ID has form track_<main_track_id>_<child_track_id> - var - id_split = $(this).attr("id").split("_"), - track_id = id_split[1], - child_id = id_split[2]; - - // Get track. - var track = view.tracks[track_id]; - if (child_id) { - track = track.child_tracks[child_id]; - } + var saved_tracks = [], tracks; + for (var i = 0; i < view.tracks.length; i++) { + track = view.tracks[i]; // Add track. - tracks.push({ + saved_tracks.push({ "track_type": track.get_type(), "name": track.name, "hda_ldda": track.hda_ldda, "dataset_id": track.dataset_id, "prefs": track.prefs, - "is_child": (child_id ? true : false ) + // TODO: remove parent-child relationships in favor of a group. + "is_child": false }); - }); + }; // Save bookmarks. var bookmarks = []; @@ -242,7 +235,7 @@ var overview_track_name = (view.overview_track ? view.overview_track.name : null); var payload = { - 'tracks': tracks, + 'tracks': saved_tracks, 'viewport': { 'chrom': view.chrom, 'start': view.low , 'end': view.high, 'overview': overview_track_name }, 'bookmarks': bookmarks }; 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.