From c0d5d5a2c119e79c153798af9881830278bc0374 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 14 Apr 2014 18:26:15 +0600 Subject: [PATCH] Remove the autofocus from search field --- .../views/quality-gate-detail-projects-view.coffee | 1 + sonar-server/src/main/js/common/select-list.js | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sonar-server/src/main/coffee/quality-gate/views/quality-gate-detail-projects-view.coffee b/sonar-server/src/main/coffee/quality-gate/views/quality-gate-detail-projects-view.coffee index afa85c6bad7..90b3abb9773 100644 --- a/sonar-server/src/main/coffee/quality-gate/views/quality-gate-detail-projects-view.coffee +++ b/sonar-server/src/main/coffee/quality-gate/views/quality-gate-detail-projects-view.coffee @@ -17,6 +17,7 @@ define [ el: @$('#select-list-projects') width: '100%' readOnly: !@options.app.canEdit + focusSearch: false format: (item) -> item.name searchUrl: "#{baseUrl}/api/qualitygates/search?gateId=#{@options.gateId}" selectUrl: "#{baseUrl}/api/qualitygates/select" diff --git a/sonar-server/src/main/js/common/select-list.js b/sonar-server/src/main/js/common/select-list.js index 8d91dc39dca..36dd95cbab1 100644 --- a/sonar-server/src/main/js/common/select-list.js +++ b/sonar-server/src/main/js/common/select-list.js @@ -199,9 +199,11 @@ requirejs(['backbone'], function (Backbone) { var searchInput = this.$('.select-list-search-control input') .on('keyup', _.debounce(keyup, 250)); - setTimeout(function () { - searchInput.focus(); - }, 250); + if (this.settings.focusSearch) { + setTimeout(function () { + searchInput.focus(); + }, 250); + } this.listItemViews = []; @@ -403,6 +405,7 @@ requirejs(['backbone'], function (Backbone) { height: 400, readOnly: false, + focusSearch: true, format: function (item) { return item.value; -- 2.39.5