diff options
author | Simon Knox <psimyn@gmail.com> | 2017-03-17 11:10:35 +1100 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-03-21 01:46:08 +1100 |
commit | 51f07069071673332703e8778a7d3a52041558d4 (patch) | |
tree | df0702f27a42ceb2e4babd99a148a72ef9c8ca7c /app/assets/javascripts | |
parent | 0eff4f14ccae7d979e6fa20f0bb875e4591351e8 (diff) | |
download | gitlab-ce-51f07069071673332703e8778a7d3a52041558d4.tar.gz |
handle commas in Issue total count
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/issue.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/issue.js b/app/assets/javascripts/issue.js index ef4029a8623..47e675f537e 100644 --- a/app/assets/javascripts/issue.js +++ b/app/assets/javascripts/issue.js @@ -2,6 +2,7 @@ /* global Flash */ require('./flash'); +require('~/lib/utils/text_utility'); require('vendor/jquery.waitforimages'); require('./task_list'); @@ -50,20 +51,21 @@ class Issue { success: function(data, textStatus, jqXHR) { if ('id' in data) { $(document).trigger('issuable:change'); - const currentTotal = Number($('.issue_counter').text()); + let total = Number($('.issue_counter').text().replace(/[^\d]/, '')); if (isClose) { $('a.btn-close').addClass('hidden'); $('a.btn-reopen').removeClass('hidden'); $('div.status-box-closed').removeClass('hidden'); $('div.status-box-open').addClass('hidden'); - $('.issue_counter').text(currentTotal - 1); + total -= 1; } else { $('a.btn-reopen').addClass('hidden'); $('a.btn-close').removeClass('hidden'); $('div.status-box-closed').addClass('hidden'); $('div.status-box-open').removeClass('hidden'); - $('.issue_counter').text(currentTotal + 1); + total += 1; } + $('.issue_counter').text(gl.text.addDelimiter(total)); } else { new Flash(issueFailMessage, 'alert'); } |