]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5007 Enhance tab navigation with query filter
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 13 Jun 2014 16:14:15 +0000 (18:14 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 13 Jun 2014 16:14:23 +0000 (18:14 +0200)
sonar-server/src/main/coffee/coding-rules/views/filter-bar-view.coffee
sonar-server/src/main/coffee/coding-rules/views/filters/query-filter-view.coffee
sonar-server/src/main/hbs/coding-rules/coding-rules-query-filter.hbs
sonar-server/src/main/js/navigator/filters/filter-bar.js

index f1a4f157098c7525f5ac6be112ebf7ed4e9c83e8..84641dd998e727fe72ad4525d545d859fa019e54 100644 (file)
@@ -23,6 +23,10 @@ define [
       'click .navigator-filter-submit': 'search'
 
 
+    onRender: ->
+      @selectFirst()
+
+
     getQuery: ->
       query = {}
       @collection.each (filter) ->
index 296723de93528670021cb5a3eedb3577d5bdc9a2..0787524837fc0ff006b2e38688238c4a72ee7c8b 100644 (file)
@@ -21,6 +21,8 @@ define [
 
     events:
       'change input': 'change'
+      'click': 'focus'
+      'blur': 'blur'
 
 
     change: (e) ->
@@ -34,14 +36,14 @@ define [
       @focus()
 
 
-    onShow: ->
-      @focus()
-
-
     focus: ->
       @$(':input').focus();
 
 
+    blur: ->
+      @$(':input').blur();
+
+
     serializeData: ->
       return _.extend({}, @model.toJSON(),
         value: this.model.get('value') || ''
index fdfe9ab5e9a90851be1971d0c0dd3261ede2534f..392a69042f28cfe4fe576ac773f3254bd488e71a 100644 (file)
@@ -1,3 +1,3 @@
-<input type="text" autofocus="autofocus"
+<input type="text"
   size="{{size}}" name="{{property}}" value="{{value}}"
   class="query-filter-input"/>
index 761dbe337e260c27128f2a349d8d98aaf858c12d..6e9aedf7809eec82cab8e810fa176da0ffd7f269 100644 (file)
@@ -97,6 +97,7 @@ define(
         selectPrev: function() {
           var filters = this.getEnabledFilters();
           if (this.selected > 0) {
+            filters.eq(this.selected).blur();
             this.selected--;
             filters.eq(this.selected).click();
             this.$('.navigator-filter-submit').blur();
@@ -107,6 +108,7 @@ define(
         selectNext: function() {
           var filters = this.getEnabledFilters();
           if (this.selected < filters.length - 1) {
+            filters.eq(this.selected).blur();
             this.selected++;
             filters.eq(this.selected).click();
           } else {