Files
galaxy/static/scripts/mvc/workflow/workflow-view-node.js
T

3 lines
2.0 KiB
JavaScript

"use strict";define(["libs/underscore","mvc/workflow/workflow-view-terminals","mvc/workflow/workflow-view-data"],function(t,e,i){return Backbone.View.extend({initialize:function(t){this.node=t.node,this.output_width=Math.max(150,this.$el.width()),this.tool_body=this.$el.find(".toolFormBody"),this.tool_body.find("div").remove(),this.newInputsDiv().appendTo(this.tool_body),this.terminalViews={},this.outputViews={}},render:function(){this.renderToolLabel(),this.renderToolErrors(),this.$el.css("width",Math.min(250,Math.max(this.$el.width(),this.output_width)))},renderToolLabel:function(){this.$(".nodeTitle").text(this.node.label||this.node.name)},renderToolErrors:function(){this.node.errors?this.$el.addClass("tool-node-error"):this.$el.removeClass("tool-node-error")},newInputsDiv:function(){return $("<div/>").addClass("inputs")},updateMaxWidth:function(t){this.output_width=Math.max(this.output_width,t)},addRule:function(){this.tool_body.append($("<div/>").addClass("rule"))},addDataInput:function(t,n){var o=!0;n||(n=this.$(".inputs"),o=!1);var a=this.terminalViews[t.name],s="dataset_collection"==t.input_type?e.InputCollectionTerminalView:e.InputTerminalView;if(!a||a instanceof s||(a.el.terminal.destroy(),a=null),a){var l=a.el.terminal;l.update(t),l.destroyInvalidConnections()}else a=new s({node:this.node,input:t});this.terminalViews[t.name]=a;var d=a.el,r=new i.DataInputView({terminalElement:d,input:t,nodeView:this,skipResize:o}).$el;return n.append(r.prepend(a.terminalElements())),a},addDataOutput:function(t){var n=new(t.collection?e.OutputCollectionTerminalView:e.OutputTerminalView)({node:this.node,output:t}),o=new i.DataOutputView({output:t,terminalElement:n.el,nodeView:this});this.outputViews[t.name]=o,this.tool_body.append(o.$el.append(n.terminalElements()))},redrawWorkflowOutputs:function(){t.each(this.outputViews,function(t){t.redrawWorkflowOutput()})},updateDataOutput:function(t){this.node.output_terminals[t.name].update(t)}})});
//# sourceMappingURL=../../../maps/mvc/workflow/workflow-view-node.js.map