diff --git a/static/scripts/galaxy.workflow_editor.canvas.js b/static/scripts/galaxy.workflow_editor.canvas.js index d73273e0f51..820d7f3ddef 100644 --- a/static/scripts/galaxy.workflow_editor.canvas.js +++ b/static/scripts/galaxy.workflow_editor.canvas.js @@ -171,6 +171,11 @@ function Node( element ) { this.tool_errors = {}; } $.extend( Node.prototype, { + new_input_terminal : function( input ) { + var t = $("
"); + this.enable_input_terminal( t, input.name, input.extensions, input.multiple ); + return t; + }, enable_input_terminal : function( elements, name, types, multiple ) { var node = this; $(elements).each( function() { @@ -317,8 +322,7 @@ $.extend( Node.prototype, { b.find( "div" ).remove(); var ibox = $("
").appendTo( b ); $.each( data.data_inputs, function( i, input ) { - var t = $("
"); - node.enable_input_terminal( t, input.name, input.extensions, input.multiple ); + var t = node.new_input_terminal( input ); var ib = $("
" + input.label + "
" ); ib.css({ position:'absolute', left: -1000, @@ -420,8 +424,7 @@ $.extend( Node.prototype, { var new_body = $("
"); var old = old_body.find( "div.input-data-row"); $.each( data.data_inputs, function( i, input ) { - var t = $("
"); - node.enable_input_terminal( t, input.name, input.extensions, input.multiple ); + var t = node.new_input_terminal( input ); // If already connected save old connection old_body.find( "div[name='" + input.name + "']" ).each( function() { $(this).find( ".input-terminal" ).each( function() {