Skip to content

Commit

Permalink
Merge c473ab2 into 57a86a4
Browse files Browse the repository at this point in the history
  • Loading branch information
rthewhite committed Nov 2, 2015
2 parents 57a86a4 + c473ab2 commit e2b5945
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
9 changes: 7 additions & 2 deletions dist/amd/behaviors/filterable-store.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/amd/behaviors/filterable-store.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions src/behaviors/filterable-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class FilterableStoreBehavior extends Behavior {
constructor(instance, {collection, transformerWeight} = {}) {
super(...arguments);

this.searchText = null;
this.collection = collection || 'items';
this.transformerWeight = transformerWeight || 25;
this.filters = new Map();
Expand Down Expand Up @@ -49,11 +50,15 @@ export class FilterableStoreBehavior extends Behavior {
this.doFilter();
}

onChangeSearch(expression) {
this.onChangeFilter('__search', expression);
onChangeSearch(searchText) {
if (angular.isString(searchText) && searchText.trim().length > 0) {
this.searchText = searchText;
this.onChangeFilter('__search', searchText);
}
}

onClearSearch() {
this.searchText = null;
this.onClearFilter('__search');
}

Expand Down

0 comments on commit e2b5945

Please sign in to comment.