diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-04-14 10:57:39 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-04-14 10:57:39 +0200 |
commit | de3df7e5fea866d114b402a6c9fe71545e2afcdc (patch) | |
tree | 127f15458dd80db593325c7e3d36b0a104d6dc03 /server/sonar-web/src/main/js/apps/coding-rules/facets | |
parent | b09c52cd3808a9726ec9bd9d510a59dcb1fcea54 (diff) | |
download | sonarqube-de3df7e5fea866d114b402a6c9fe71545e2afcdc.tar.gz sonarqube-de3df7e5fea866d114b402a6c9fe71545e2afcdc.zip |
SONAR-7419 Can not clear search input on rules page
Diffstat (limited to 'server/sonar-web/src/main/js/apps/coding-rules/facets')
-rw-r--r-- | server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js index 8192403a2f6..d448c53ca02 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js @@ -26,7 +26,8 @@ export default BaseFacet.extend({ events () { return _.extend(BaseFacet.prototype.events.apply(this, arguments), { - 'submit form': 'onFormSubmit' + 'submit form': 'onFormSubmit', + 'search input': 'onInputSearch' }); }, @@ -44,10 +45,18 @@ export default BaseFacet.extend({ this.applyFacet(); }, + onInputSearch () { + this.applyFacet(); + }, + applyFacet () { const obj = {}; const property = this.model.get('property'); - obj[property] = this.$('input').val(); - this.options.app.state.updateFilter(obj, { force: true }); + const value = this.$('input').val(); + if (this.buffer !== value) { + this.buffer = value; + obj[property] = value; + this.options.app.state.updateFilter(obj, { force: true }); + } } }); |