From d7ac52f6bb61fe360198f91310a3e22076183d7b Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sat, 5 Dec 2015 17:49:33 +0000 Subject: [PATCH] Add icons to existing workflow steps in workflow editor. Tools have an icon there. --- .../scripts/mvc/workflow/workflow-view.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view.js b/client/galaxy/scripts/mvc/workflow/workflow-view.js index c8d6a9bd4d5..cd799467ab4 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-view.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-view.js @@ -44,6 +44,21 @@ function reset_tool_search( initValue ) { } } +NODE_ICONS = { + 'tool': 'fa-wrench', + 'data_input': 'fa-file-o', + 'data_collection_input': 'fa-folder-o', + 'pause': 'fa-pause' +} + +add_node_icon = function($to_el, nodeType) { + var iconStyle = NODE_ICONS[nodeType]; + if(iconStyle) { + var $icon = $(' ').addClass(iconStyle); + $to_el.before($icon); + } +} + // Really a shell of a real backbone view, but refactoring in the right // direction I think. @@ -62,6 +77,8 @@ EditorFormView = Backbone.View.extend({ if (node && node.id != 'no-node') { $el.find('table:first').after(this._genericStepAttributesTemplate( node )); + var nodeType = node.type; + add_node_icon($el.find('.portlet-title-text'), nodeType); ($el.find( 'form' ).length > 0) && $el.find( 'form' ).ajaxForm( { type: 'POST', dataType: 'json',