commit/galaxy-central: jgoecks: Trackster: when running tools, replace track with group.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/d6d62cb3cf7e/ changeset: d6d62cb3cf7e user: jgoecks date: 2011-12-22 19:11:34 summary: Trackster: when running tools, replace track with group. affected #: 1 file diff -r 83756dd3d868aee6d319f0d1904a1dcdda12b5b9 -r d6d62cb3cf7ea7b7a11a5ca4caf4a85c50a31a93 static/scripts/trackster.js --- a/static/scripts/trackster.js +++ b/static/scripts/trackster.js @@ -946,6 +946,20 @@ return false; }, /** + * Replace one drawable with another. + */ + replace_drawable: function(old_drawable, new_drawable, update_html) { + var index = this.drawables.indexOf(old_drawable); + if (index !== -1) { + this.drawables[index] = new_drawable; + if (update_html) { + old_drawable.container_div.replaceWith(new_drawable.container_div); + } + return true; + } + return false; + }, + /** * Remove drawable from this collection. */ remove_drawable: function(drawable) { @@ -1002,7 +1016,11 @@ } ].concat(Drawable.prototype.action_icons_def), build_container_div: function() { - return $("<div/>").addClass("group").attr("id", "group_" + this.id).appendTo(this.container.content_div); + var container_div = $("<div/>").addClass("group").attr("id", "group_" + this.id); + if (this.container) { + this.container.content_div.append(container_div); + } + return container_div; }, build_header_div: function() { var header_div = $("<div/>").addClass("track-header"); @@ -1787,8 +1805,9 @@ // If track not in a group, create a group for it and add new track to group. If track // already in group, add track to group. if (current_track.container === view) { - var group = new DrawableGroup(this.name, this.track.view, this.track.container); - current_track.container.add_drawable(group); + // Create new group. + var group = new DrawableGroup(this.name, this.track.view); + current_track.container.replace_drawable(current_track, group, true); // TODO: this is ugly way to move track from one container to another -- make this easier via // a Drawable or DrawableCollection function. current_track.container.remove_drawable(current_track); @@ -1797,6 +1816,7 @@ container = group; } else { + // Use current group. container = current_track.container; } 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