diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-06-27 11:06:18 +0200 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-06-27 11:06:23 +0200 |
commit | d4f86b07aea02808effebf2abf5234b114cc9250 (patch) | |
tree | 9944ab3d2aeac877d5a465dba86ce70faec00d01 | |
parent | 20d760166ebd55838d6b523423857153c09fe255 (diff) | |
download | sonarqube-d4f86b07aea02808effebf2abf5234b114cc9250.tar.gz sonarqube-d4f86b07aea02808effebf2abf5234b114cc9250.zip |
SONAR-5133 SONAR-5134 Properly handle enter key on query input field
-rw-r--r-- | sonar-server/src/main/coffee/coding-rules/views/filters/query-filter-view.coffee | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sonar-server/src/main/coffee/coding-rules/views/filters/query-filter-view.coffee b/sonar-server/src/main/coffee/coding-rules/views/filters/query-filter-view.coffee index 989fddcbd5c..b9cfa417a5d 100644 --- a/sonar-server/src/main/coffee/coding-rules/views/filters/query-filter-view.coffee +++ b/sonar-server/src/main/coffee/coding-rules/views/filters/query-filter-view.coffee @@ -20,6 +20,7 @@ define [ className: 'navigator-filter navigator-filter-query' events: + 'keypress input': 'checkSubmit' 'change input': 'change' 'click': 'focus' 'blur': 'blur' @@ -54,6 +55,16 @@ define [ @model.set('size', 25) unless @model.get 'size' + checkSubmit: (e) -> + if (e.which == 13) + e.preventDefault() + console.log e + @change(e) + @blur() + @options.app.filterBarView.$('.navigator-filter-submit').focus() + @options.app.filterBarView.$('.navigator-filter-submit').click() + + renderInput: -> # Done in template |