From e8ded03ec40e0ba3d17b9e3e57805ce9afd43534 Mon Sep 17 00:00:00 2001 From: alexwl Date: Wed, 13 Feb 2019 23:44:05 +0300 Subject: Add a switch between 'search in the current package' and 'search in all packages' on the package page --- javascript/app/components/input-with-autocomplete.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'javascript/app/components/input-with-autocomplete.js') diff --git a/javascript/app/components/input-with-autocomplete.js b/javascript/app/components/input-with-autocomplete.js index 2b09ea4..34abe7a 100644 --- a/javascript/app/components/input-with-autocomplete.js +++ b/javascript/app/components/input-with-autocomplete.js @@ -97,10 +97,15 @@ export default Ember.Component.extend({ }); }, showAutocompleteList() { - this.$autocompleteContainer.css({ - "display":"block" - }); + if(this.get('query') !== "") { + this.$autocompleteContainer.css({ + "display":"block" + }); + } }, + searchUrlObserver : Ember.observer('createSearchUrlFunction',function() { + this.notifyPropertyChange('query'); + }), queryObserver : Ember.observer("query",function() { if(this.get('query')) { const perPage = this.get('maxItems') ? this.get('maxItems') : 10; -- cgit v1.2.3