summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-08-29 12:52:22 +0300
committerAndrew Dolgov <[email protected]>2019-08-29 12:52:22 +0300
commit781fe3d636c79c3216a106afbf8ecf7d45c13a99 (patch)
treec485ff10bdb3e74c871ae1976b9729cad9ec57ba /js
parent12a542977e3826dda37594fa01879d1bdad5a4f8 (diff)
setScore, selectionSetScore: check for numerical values properly
Diffstat (limited to 'js')
-rw-r--r--js/Article.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/js/Article.js b/js/Article.js
index b933ed716..970234818 100644
--- a/js/Article.js
+++ b/js/Article.js
@@ -32,7 +32,7 @@ define(["dojo/_base/declare"], function (declare) {
if (ids.length > 0) {
const score = prompt(__("Please enter new score for selected articles:"));
- if (parseInt(score) != undefined) {
+ if (!isNaN(parseInt(score))) {
ids.each((id) => {
const row = $("RROW-" + id);
@@ -66,7 +66,7 @@ define(["dojo/_base/declare"], function (declare) {
const score_old = row.getAttribute("data-score");
const score = prompt(__("Please enter new score for this article:"), score_old);
- if (parseInt(score) != undefined) {
+ if (!isNaN(parseInt(score))) {
row.setAttribute("data-score", score);
const pic = row.select(".icon-score")[0];
@@ -340,4 +340,4 @@ define(["dojo/_base/declare"], function (declare) {
}
return Article;
-}); \ No newline at end of file
+});