Better handling of workflow step annotations.

This commit is contained in:
Jeremy Goecks
2010-03-04 16:16:42 -05:00
parent 1ddf20dcc3
commit 953ddfd9e1
2 changed files with 10 additions and 5 deletions
@@ -308,6 +308,7 @@ $.extend( Node.prototype, {
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 @@ $.extend( Workflow.prototype, {
// 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;
}
},
+3 -4
View File
@@ -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 );
}