diff --git a/client/galaxy/scripts/mvc/library/library-folderlist-view.js b/client/galaxy/scripts/mvc/library/library-folderlist-view.js index f55714b96cb..1b6c271f99c 100644 --- a/client/galaxy/scripts/mvc/library/library-folderlist-view.js +++ b/client/galaxy/scripts/mvc/library/library-folderlist-view.js @@ -277,6 +277,21 @@ var FolderListView = Backbone.View.extend({ this.renderSortIcon(); }, + /** + * In case the search_term is not empty perform the search and render + * the result. Render all visible folder items otherwise. + * @param {string} search_term string to search for + */ + searchFolder: function(search_term) { + const trimmed_term = $.trim(search_term); + if (trimmed_term !== "") { + const result_collection = this.folder_container.search(search_term); + this.collection.reset(result_collection); + } else { + this.paginate(); + } + }, + /** * User clicked the checkbox in the table heading * @param {context} event @@ -466,7 +481,7 @@ var FolderListView = Backbone.View.extend({ <%- path_item[1] %> - + <% } else { %>