Skip to content

Commit

Permalink
To clear workflow tool search field press ESC or click the X button
Browse files Browse the repository at this point in the history
  • Loading branch information
scrathat committed Jun 6, 2018
1 parent 1d52f04 commit 57f3195
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion client/galaxy/scripts/mvc/workflow/workflow-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,23 @@ export default Backbone.View.extend({
});
};

// Clear search by clicking X button
$("#search-clear-btn").click(function() {
$("#tool-search-query").val('');
reset_tool_search(false);
})

// Init searching.
$("#tool-search-query")
.click(function() {
$(this).focus();
$(this).select();
})
.keyup(function() {
.keyup(function(e) {
// If ESC is pressed clear the search field
if (e.keyCode == 27) {
this.value='';
}
// Remove italics.
$(this).css("font-style", "normal");
// Don't update if same value as last time
Expand Down
3 changes: 2 additions & 1 deletion templates/webapps/galaxy/workflow/editor.mako
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'get_new_module_info' : h.url_for( controller='workflow', action='get_new_module_info' ),
'workflow_index' : h.url_for( '/workflows/list' ),
'save_workflow' : h.url_for( controller='workflow', action='save_workflow' ),
'workflow_save_as' : h.url_for( controller='workflow', action='save_workflow_as')
'workflow_save_as' : h.url_for( controller='workflow', action='save_workflow_as')
},
'workflows' : [{
'id' : trans.security.encode_id( workflow.id ),
Expand Down Expand Up @@ -286,6 +286,7 @@
<div id="tool-search">
%endif
<input type="text" name="query" placeholder="search tools" id="tool-search-query" class="search-query parent-width" />
<a id="search-clear-btn" title="" data-original-title="clear search (esc)"> </a>
<img src="${h.url_for('/static/images/loading_small_white_bg.gif')}" id="search-spinner" class="search-spinner" />
</div>
Expand Down

0 comments on commit 57f3195

Please sign in to comment.