diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-03-21 01:43:44 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-03-21 12:33:26 +0300 |
commit | 44455913ff189423685325f82f2b0e1b8dc67613 (patch) | |
tree | 19abc44bacd399d237586d6d32a980633df989e8 /app/assets/javascripts/issue.js | |
parent | 0b76f6551e57bed64ef6073526038aa67da041f6 (diff) |
Merge branch '29559-issue-count' into 'master'
handle commas in Issue total count
Closes #29559
See merge request !10028
Diffstat (limited to 'app/assets/javascripts/issue.js')
-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 52457f70d90..4c0e2af61be 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'); @@ -55,20 +56,21 @@ require('./task_list'); 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'); } |