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