Added square brackets to match too for the points

This commit is contained in:
José Carlos Cuevas 2019-08-13 17:13:00 +02:00
parent 184080a179
commit 0c1700090f

View file

@ -2,10 +2,10 @@ var calculateIssuePoints = function () {
let links = document.getElementsByClassName('js-project-card-issue-link');
for (let count = 0; count < links.length; count++) {
let link = links[count];
let points_mark = link.text.match(/^\(\d+\)*/);
let points_mark = link.text.match(/^[\(\[]\d+[\)\]]/);
if (points_mark) {
let points = points_mark[0].replace(/\(|\)/g, '');
link.innerHTML = link.text.replace(/^\(\d+\)/, '<span class="issue-points">' + points + '</span>');
let points = points_mark[0].replace(/\(|\)|\[|\]/g, '');
link.innerHTML = link.text.replace(/[\(\[]\d+[\)\]]/, '<span class="issue-points">' + points + '</span>');
}
};
};
@ -78,4 +78,4 @@ var updatePoints = function () {
drawProgressBars(to_do, doing, done);
};
window.setInterval(updatePoints, 2000);
window.setInterval(updatePoints, 3000);