aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-07-12 10:30:05 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-07-12 10:30:05 +0200
commite1d66ea82c63bd4764adb79674557821ccde9fff (patch)
tree9162dab5b52f188d1b9d720f4dd6c169e8f63bea
parentc5461cfceb990f43c4a6cc3322c50616858b3578 (diff)
downloadsonarqube-e1d66ea82c63bd4764adb79674557821ccde9fff.tar.gz
sonarqube-e1d66ea82c63bd4764adb79674557821ccde9fff.zip
SONAR-4063 When adding a criterion in the Measure Service, set the focus to this added criterion
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb34
1 files changed, 19 insertions, 15 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb
index eca9640c027..4f714c2eacf 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb
@@ -35,21 +35,6 @@
.on("change", function (e) {
$j("#criteria-" + e.val).insertBefore($j("#more-td")).show();
- if (e.val == 'lang' || e.val == 'project' || e.val == 'alert') {
- $j("#select-" + e.val).select2("enable");
- $j("#select-" + e.val).select2("focus");
- } else if (e.val == 'fav') {
- $j('#check-fav').attr('checked', 'checked');
- } else if (e.val == 'date') {
- $j("#criteria-" + e.val + " input[name=fromDate]").focus();
- } else if (e.val == 'age') {
- $j("#criteria-" + e.val + " input[name=ageMinDays]").focus();
- } else if (e.val == 'key') {
- $j("#criteria-" + e.val + " input").focus();
- } else if (e.val == 'name') {
- $j("#criteria-" + e.val + " input").focus();
- }
-
if (e.val == 'metric') {
if (hiddenConditionIndexes.length > 0) {
var index = hiddenConditionIndexes.pop();
@@ -66,7 +51,26 @@
}
} else {
// applies to any criteria except metrics
+
+ // remove disabled attribute before setting focus otherwise the focus will not be done. SONAR-4063
$j("#criteria-" + e.val + " input").removeAttr('disabled');
+
+ if (e.val == 'lang' || e.val == 'project' || e.val == 'alert') {
+ $j("#select-" + e.val).select2("enable");
+ $j("#select-" + e.val).select2("focus");
+ } else if (e.val == 'fav') {
+ $j('#check-fav').attr('checked', 'checked');
+ $j('#check-fav').focus();
+ } else if (e.val == 'date') {
+ $j("#criteria-" + e.val + " input[name=fromDate]").focus();
+ } else if (e.val == 'age') {
+ $j("#criteria-" + e.val + " input[name=ageMinDays]").focus();
+ } else if (e.val == 'key') {
+ $j("#criteria-" + e.val + " input").focus();
+ } else if (e.val == 'name') {
+ $j("#criteria-" + e.val + " input").focus();
+ }
+
$j("#more-criteria option[value='" + e.val + "']").remove();
}
$j("#more-criteria").select2("val", "");