aboutsummaryrefslogtreecommitdiff
path: root/javascript/app/components/input-with-autocomplete.js
diff options
context:
space:
mode:
authoralexwl <alexey.a.kiryushin@gmail.com>2019-02-13 23:44:05 +0300
committeralexwl <alexey.a.kiryushin@gmail.com>2019-02-13 23:44:05 +0300
commite8ded03ec40e0ba3d17b9e3e57805ce9afd43534 (patch)
treeb669e381faed51dff9445fe6d869513c46cb5589 /javascript/app/components/input-with-autocomplete.js
parent0b17136d965ddc602a5a0176b538bdb0a47f4d12 (diff)
Add a switch between 'search in the current package' and 'search in all packages' on the package page
Diffstat (limited to 'javascript/app/components/input-with-autocomplete.js')
-rw-r--r--javascript/app/components/input-with-autocomplete.js11
1 files changed, 8 insertions, 3 deletions
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;