Skip to content

Commit

Permalink
Revision
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Feb 18, 2016
1 parent 7b8f675 commit 580895a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
29 changes: 11 additions & 18 deletions client/galaxy/scripts/mvc/workflow/workflow-view-node.js
Expand Up @@ -2,7 +2,7 @@ define(['libs/underscore', 'mvc/workflow/workflow-view-terminals', 'mvc/workflow
return Backbone.View.extend( {
initialize: function( options ){
this.node = options.node;
this.output_width = Math.max(150, this.$el.width());
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 );
Expand All @@ -11,36 +11,29 @@ define(['libs/underscore', 'mvc/workflow/workflow-view-terminals', 'mvc/workflow
},

render: function() {
var label = this.node.label;
var title;
if(label) {
title = label;
} else {
title = this.node.name;
}
this.$el.find(".nodeTitle").text(title);
this.renderToolLabel();
this.renderToolErrors();
this.$el.css( "width", Math.min(250, Math.max( this.$el.width(), this.output_width )));
this.$el.css( "width", Math.min(250, Math.max( this.$el.width(), this.output_width ) ) );
},

renderToolErrors: function( ) {
if ( this.node.tool_errors ) {
this.$el.addClass( "tool-node-error" );
} else {
this.$el.removeClass( "tool-node-error" );
}
renderToolLabel: function() {
this.$( '.nodeTitle' ).text( this.node.label || this.node.name );
},

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>");
return $( '<div/>' ).addClass( 'inputs' );
},

updateMaxWidth: function( newWidth ) {
this.output_width = Math.max( this.output_width, newWidth );
},

addRule: function() {
this.tool_body.append( $( "<div class='rule'></div>" ) );
this.tool_body.append( $( '<div/>' ).addClass( 'rule' ) );
},

addDataInput: function( input, body ) {
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/workflow/workflow-view-node.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/scripts/mvc/workflow/workflow-view-node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 580895a

Please sign in to comment.