commit/galaxy-central: jgoecks: Trackster: fix bugs in e1da72b42db7 that prevented adding tracks.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/f148a319a313/ changeset: f148a319a313 user: jgoecks date: 2011-12-09 23:03:33 summary: Trackster: fix bugs in e1da72b42db7 that prevented adding tracks. affected #: 2 files diff -r e1da72b42db7abbb3a1e3a9d842341aef5c28d9e -r f148a319a3138843926a26b278793d3fd4a55fbc static/scripts/trackster_ui.js --- a/static/scripts/trackster_ui.js +++ b/static/scripts/trackster_ui.js @@ -29,6 +29,19 @@ }; /** + * Create object from a dictionary. + */ +var object_from_dict = function(track_dict, container) { + var + drawable_type = track_dict['obj_type']; + // For backward compatibility: + if (!drawable_type) { + drawable_type = track_dict['track_type']; + } + return addable_objects[ drawable_type ].prototype.from_dict(track_dict, container); +}; + +/** * Objects that can be added to a view. */ var addable_objects = { @@ -68,14 +81,7 @@ drawable_type, drawable; for (var i = 0; i < drawables_config.length; i++) { - drawable_config = drawables_config[i]; - drawable_type = drawable_config['obj_type']; - // For backward compatibility: - if (!drawable_type) { - drawable_type = drawable_config['track_type']; - } - drawable = addable_objects[ drawable_type ].prototype.from_dict( drawable_config, view ); - view.add_drawable( drawable ); + view.add_drawable( object_from_dict( drawables_config[i], view ) ); } } diff -r e1da72b42db7abbb3a1e3a9d842341aef5c28d9e -r f148a319a3138843926a26b278793d3fd4a55fbc templates/tracks/browser.mako --- a/templates/tracks/browser.mako +++ b/templates/tracks/browser.mako @@ -100,7 +100,7 @@ [ arguments[0] ] ); for (var i= 0; i < track_defs.length; i++) { - view.add_drawable( track_from_dict(track_defs[i], view) ); + view.add_drawable( object_from_dict(track_defs[i], view) ); } }); hide_modal(); @@ -214,7 +214,7 @@ url: "${h.url_for( action='add_track_async' )}", data: { hda_id: "${add_dataset}" }, dataType: "json", - success: function(track_data) { view.add_drawable( track_from_dict(track_data, view) ) } + success: function(track_data) { view.add_drawable( object_from_dict(track_data, view) ) } }); %endif 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