]> source.dussan.org Git - sonarqube.git/commitdiff
fix search field on coding rules page on IE11
authorStas Vilchik <vilchiks@gmail.com>
Thu, 19 Feb 2015 15:16:01 +0000 (16:16 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 19 Feb 2015 15:16:10 +0000 (16:16 +0100)
server/sonar-web/src/main/hbs/coding-rules/facets/coding-rules-query-facet.hbs
server/sonar-web/src/main/js/coding-rules/facets/query-facet.js

index 7f30a435cb77eccb5da51c726b49bff1ce3f5588..d26b4f3c12c9d828f9d3c5e3b0cb207246cd6f8e 100644 (file)
@@ -1,3 +1,5 @@
 <div class="search-navigator-facet-query">
-  <input type="text" class="search-navigator-facet-input" name="q" placeholder="{{t 'search_verb'}}">
+  <form>
+    <input type="text" class="search-navigator-facet-input" name="q" placeholder="{{t 'search_verb'}}">
+  </form>
 </div>
index a657399949fdd0d65606be62c23c0f3a8cdb7ec2..fe9e4f695edcd483d412727a0b3cfe6a25b5d52f 100644 (file)
@@ -8,8 +8,7 @@ define([
 
     events: function () {
       return _.extend(BaseFacet.prototype.events.apply(this, arguments), {
-        'change input': 'applyFacet',
-        'keydown input': 'onKeydown'
+        'submit form': 'onFormSubmit'
       });
     },
 
@@ -22,18 +21,16 @@ define([
       }
     },
 
+    onFormSubmit: function (e) {
+      e.preventDefault();
+      this.applyFacet();
+    },
+
     applyFacet: function() {
       var obj = {},
           property = this.model.get('property');
       obj[property] = this.$('input').val();
       this.options.app.state.updateFilter(obj);
-    },
-
-    onKeydown: function (e) {
-      // escape
-      if (e.keyCode === 27) {
-        this.$('input').blur();
-      }
     }
   });