diff --git a/js/app/views/filter.js b/js/app/views/filter.js index e5abfd4..8492f24 100644 --- a/js/app/views/filter.js +++ b/js/app/views/filter.js @@ -20,6 +20,7 @@ define("views/filter", function(require) { }, initialize: function() { this.channel = Radio.channel("Sounds"); + this.channel.on("sounds:reset", this.resetFilter.bind(this)); }, filterSounds: function(e) { var value = this.$el.find(this.ui.searchField).val(); @@ -35,7 +36,9 @@ define("views/filter", function(require) { this.channel.trigger("sounds:filter", value); }, resetFilter: function(e) { - e.preventDefault(); + if (e) { + e.preventDefault(); + } this.$el.find(this.ui.searchField).val(''); this.$el.find(this.ui.searchForm).submit();