diff --git a/addon/components/search-flow.js b/addon/components/search-flow.js index 366d6e2..bb9bf19 100644 --- a/addon/components/search-flow.js +++ b/addon/components/search-flow.js @@ -24,7 +24,7 @@ export default Ember.Component.extend({ return parameter.toLowerCase() === param.name.toLowerCase(); }); }, - processQueries: Ember.observer('query,parameters', function () { + processQueries: Ember.observer('query', 'parameters', function () { if (this.get('queryGeneratedByComponent')) { this.set('queryGeneratedByComponent', false); return; @@ -64,7 +64,7 @@ export default Ember.Component.extend({ }); }); }), - availableParameters: Ember.computed('parameters,filters.[],filters.@each.parameter,parameters.@each.suggested', function () { + availableParameters: Ember.computed('parameters', 'filters.[]', 'filters.@each.parameter', 'parameters.@each.suggested', function () { return this.get('parameters').reject(parameter => { return !parameter.name || !parameter.title || (parameter.allowMultiple === false && this.get('filters').find(filter => { return filter.get('parameter.name') === parameter.name; @@ -129,7 +129,7 @@ export default Ember.Component.extend({ this.get('onQueryUpdated')(query); } }, - canAddNewFilter: Ember.computed('isSelectingParameter,filters.[],filters.@each.isFocused,maxFilters', function () { + canAddNewFilter: Ember.computed('isSelectingParameter', 'filters.[]', 'filters.@each.isFocused', 'maxFilters', function () { if (this.get('isSelectingParameter')) { return false; } @@ -139,7 +139,7 @@ export default Ember.Component.extend({ return !this.get('filters').isAny('isFocused'); }), actions: { - newFilter() { + newFilter(event) { if (event.which === 13) { // Enter key // Must prevent the filter from auto selecting an option this.set('didHitEnter', true); @@ -182,4 +182,4 @@ export default Ember.Component.extend({ this.generateQuery(); }, } -}); \ No newline at end of file +}); diff --git a/addon/components/search-flow/input-dropdown.js b/addon/components/search-flow/input-dropdown.js index 359221b..2a233ab 100644 --- a/addon/components/search-flow/input-dropdown.js +++ b/addon/components/search-flow/input-dropdown.js @@ -45,7 +45,7 @@ export default Ember.Component.extend({ this.$('.search-flow_input').css('width', tempDiv.width() + 3); tempDiv.remove(); }, - availableOptions: Ember.computed('options.[],value', function () { + availableOptions: Ember.computed('options.[]', 'value', function () { let options = this.get('options'); if (!options || !this.get('filter.isFocused')) { return Ember.A([]); @@ -72,7 +72,7 @@ export default Ember.Component.extend({ if (this.get('filter.parameter.sort')){ options = options.sortBy('title'); } - + // Insert contains option into list if (this.get('filter.parameter.contains') && this.get('value') && options.length) { options.unshift(Ember.Object.create({ title: `Contains: ${this.get('value')}`, value: this.get('value'), isContains: true })); @@ -114,7 +114,7 @@ export default Ember.Component.extend({ this.get('newFilter')(activeOption.get('value')); } else { - + this.set('filter.value', activeOption.get('value')); if (activeOption.get('isContains')) { this.set('filter.isContains', true); @@ -135,7 +135,7 @@ export default Ember.Component.extend({ this.send('selectOption', this.get('activeOption')); } }, - inputKeyDown() { + inputKeyDown(_, event) { if (event.which === 38) { // Up event.preventDefault(); let previousItem = this.get(`availableOptions.${this.get('activeOption.index') - 1}`); @@ -158,7 +158,7 @@ export default Ember.Component.extend({ this.blurInput(); } }, - inputKeyUp() { + inputKeyUp(_, event) { // Prevent the up or down key from moving the cursor when releasing the key if (event.which === 38 || event.which === 40) { // Up or Down event.preventDefault(); @@ -183,7 +183,7 @@ export default Ember.Component.extend({ // Set the value to what the original filter value was this.set('filter.isFocused', false); - if (this.get('filter.isContains')) { + if (this.get('filter.isContains')) { this.set('value', `Contains: ${this.get('filter.value')}`); } this.get('inputBlurred')(this.get('isParameterSelection'), this.get('filter'), this.get('shouldRemoveFilter')); diff --git a/addon/templates/components/search-flow.hbs b/addon/templates/components/search-flow.hbs index ca79579..6c1d748 100644 --- a/addon/templates/components/search-flow.hbs +++ b/addon/templates/components/search-flow.hbs @@ -2,7 +2,7 @@ {{#each filters as |filter|}}