aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/javascripts
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-03-05 16:39:55 +0100
committerStas Vilchik <vilchiks@gmail.com>2014-03-05 16:40:01 +0100
commitd5a6fb0e3f9714f4350afe8a2407b970d48eadfe (patch)
treedf6192d007f45cb335ab3bfbf218a93de14e2320 /sonar-server/src/main/webapp/javascripts
parent4f01aaa6d0c0179cf1abde076d279d83512e571b (diff)
downloadsonarqube-d5a6fb0e3f9714f4350afe8a2407b970d48eadfe.tar.gz
sonarqube-d5a6fb0e3f9714f4350afe8a2407b970d48eadfe.zip
SONAR-5083 Fix bug with restoring RATING
Diffstat (limited to 'sonar-server/src/main/webapp/javascripts')
-rw-r--r--sonar-server/src/main/webapp/javascripts/common/inputs.coffee2
-rw-r--r--sonar-server/src/main/webapp/javascripts/common/inputs.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/javascripts/common/inputs.coffee b/sonar-server/src/main/webapp/javascripts/common/inputs.coffee
index 8f7f491e6b9..c914068b9e4 100644
--- a/sonar-server/src/main/webapp/javascripts/common/inputs.coffee
+++ b/sonar-server/src/main/webapp/javascripts/common/inputs.coffee
@@ -56,7 +56,7 @@ convertValue = (value, input) ->
restoreRating = (value) ->
- return value unless typeof value == 'number'
+ return value unless /^[12345]+$/.test value
String.fromCharCode(value - 1 + 'A'.charCodeAt(0))
diff --git a/sonar-server/src/main/webapp/javascripts/common/inputs.js b/sonar-server/src/main/webapp/javascripts/common/inputs.js
index 50607e1958e..093116c9a57 100644
--- a/sonar-server/src/main/webapp/javascripts/common/inputs.js
+++ b/sonar-server/src/main/webapp/javascripts/common/inputs.js
@@ -72,7 +72,7 @@
};
restoreRating = function(value) {
- if (typeof value !== 'number') {
+ if (!/^[12345]+$/.test(value)) {
return value;
}
return String.fromCharCode(value - 1 + 'A'.charCodeAt(0));