mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
2 lines
2.0 KiB
JavaScript
2 lines
2.0 KiB
JavaScript
define(["libs/underscore","mvc/workflow/workflow-view-terminals","mvc/workflow/workflow-view-data"],function(a,b,c){return Backbone.View.extend({initialize:function(a){this.node=a.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(a){this.output_width=Math.max(this.output_width,a)},addRule:function(){this.tool_body.append($("<div/>").addClass("rule"))},addDataInput:function(a,d){var e=!0;d||(d=this.$(".inputs"),e=!1);var f=this.terminalViews[a.name],g="dataset_collection"==a.input_type?b.InputCollectionTerminalView:b.InputTerminalView;if(!f||f instanceof g||(f.el.terminal.destroy(),f=null),f){var h=f.el.terminal;h.update(a),h.destroyInvalidConnections()}else f=new g({node:this.node,input:a});this.terminalViews[a.name]=f;var i=f.el,j=new c.DataInputView({terminalElement:i,input:a,nodeView:this,skipResize:e}),k=j.$el;return d.append(k.prepend(f.terminalElements())),f},addDataOutput:function(a){var d=a.collection?b.OutputCollectionTerminalView:b.OutputTerminalView,e=new d({node:this.node,output:a}),f=new c.DataOutputView({output:a,terminalElement:e.el,nodeView:this});this.outputViews[a.name]=f,this.tool_body.append(f.$el.append(e.terminalElements()))},redrawWorkflowOutputs:function(){a.each(this.outputViews,function(a){a.redrawWorkflowOutput()})},updateDataOutput:function(a){var b=this.node.output_terminals[a.name];b.update(a)}})});
|
|
//# sourceMappingURL=../../../maps/mvc/workflow/workflow-view-node.js.map
|