[hg] galaxy 3484: Better handling of workflow step annotations.
details: http://www.bx.psu.edu/hg/galaxy/rev/d1900a25eb45 changeset: 3484:d1900a25eb45 user: jeremy goecks <jeremy.goecks@emory.edu> date: Thu Mar 04 16:16:42 2010 -0500 description: Better handling of workflow step annotations. diffstat: static/scripts/galaxy.workflow_editor.canvas.js | 8 +++++++- templates/workflow/editor.mako | 7 +++---- 2 files changed, 10 insertions(+), 5 deletions(-) diffs (43 lines): diff -r c349f517ffb8 -r d1900a25eb45 static/scripts/galaxy.workflow_editor.canvas.js --- a/static/scripts/galaxy.workflow_editor.canvas.js Thu Mar 04 13:55:21 2010 -0500 +++ b/static/scripts/galaxy.workflow_editor.canvas.js Thu Mar 04 16:16:42 2010 -0500 @@ -308,6 +308,7 @@ this.tool_state = data.tool_state; this.form_html = data.form_html; this.tool_errors = data.tool_errors; + this.annotation = data['annotation']; if ( this.tool_errors ) { el.addClass( "tool-node-error" ); } else { @@ -447,7 +448,12 @@ // If active form has changed, save it if (this.active_form_has_changes) { this.has_changes = true; - $("#right-content").find("form").submit(); + // Get annotation and add to form. + var annotation = $("textarea[name=annotation]").val(); + var tool_form = $("#right-content").find("form"); + tool_form.append( "<input type='hidden' name='annotation' value='"+annotation+"' />" ); + // Submit form. + tool_form.submit(); this.active_form_has_changes = false; } }, diff -r c349f517ffb8 -r d1900a25eb45 templates/workflow/editor.mako --- a/templates/workflow/editor.mako Thu Mar 04 13:55:21 2010 -0500 +++ b/templates/workflow/editor.mako Thu Mar 04 16:16:42 2010 -0500 @@ -367,11 +367,10 @@ </div> \ </div> \ </div>"); - // When metadata is changed, update node and set workflow changes flag. + // See above comment: this is necessary to handle autosaving. var textarea = $(metadata_div).find("textarea"); - textarea.change( function () { - node.annotation = $(this).val(); - workflow.has_changes = true; + textarea.focus( function () { + workflow.active_form_has_changes = true; }); $("#right-content").find(".toolForm").after( metadata_div ); }
participants (1)
-
Greg Von Kuster