diff --git a/client/galaxy/scripts/mvc/history/multi-panel.js b/client/galaxy/scripts/mvc/history/multi-panel.js index 6b5d664d5cd..104bcbab12e 100644 --- a/client/galaxy/scripts/mvc/history/multi-panel.js +++ b/client/galaxy/scripts/mvc/history/multi-panel.js @@ -756,7 +756,6 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ "click .order .set-order": "_chooseOrder", "click #toggle-deleted": "_clickToggleDeletedDatasets", "click #toggle-hidden": "_clickToggleHiddenDatasets" - //'dragstart .list-item .title-bar' : function( e ){ console.debug( 'ok' ); } }, close: function(ev) { @@ -768,6 +767,7 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ this.toggleDeletedHistories($(ev.currentTarget).is(":checked")); this.toggleOptionsPopover(); }, + /** Include deleted histories in the collection */ toggleDeletedHistories: function(show) { if (show) { @@ -835,7 +835,19 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ /** Set up any view plugins */ setUpBehaviors: function() { this._moreOptionsPopover(); - + const searchHistories = searchFor => { + const multipanel = this; + this.historySearch = searchFor; + this.filters = [ + function() { + // This is intentionally a function where 'this' gets + // bound, applying the filter to the model of the + // caller. + return this.model.matchesAll(multipanel.historySearch); + } + ]; + this.renderColumns(0); + }; // input to search histories this.$("#search-histories").searchInput({ name: "search-histories", @@ -847,17 +859,11 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ this.collection.fetchAll().done(() => { this.$("#search-histories").searchInput("toggle-loading"); this.renderInfo(""); + searchHistories(searchFor); }); }, - onsearch: searchFor => { - this.historySearch = searchFor; - this.filters = [ - () => { - return this.model.matchesAll(this.historySearch); - } - ]; - this.renderColumns(0); - }, + + onsearch: searchHistories, onclear: searchFor => { this.historySearch = null; //TODO: remove specifically not just reset