diff options
author | Simon Knox <psimyn@gmail.com> | 2017-02-14 09:27:29 +0300 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-02-14 09:27:29 +0300 |
commit | 142432ce5ae78cc873b9748f41e54257adc56dcc (patch) | |
tree | ed3dfb45a52dca07e0da49d12bc5daaea837ae06 /app/assets/javascripts/issue.js | |
parent | 865e3fcc13834a1503b8a6c3f7cc7826bacdcc9f (diff) |
update issue count when closing/reopening an issue
Diffstat (limited to 'app/assets/javascripts/issue.js')
-rw-r--r-- | app/assets/javascripts/issue.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/assets/javascripts/issue.js b/app/assets/javascripts/issue.js index 6c08b1b8e61..1776b3d61f6 100644 --- a/app/assets/javascripts/issue.js +++ b/app/assets/javascripts/issue.js @@ -54,16 +54,19 @@ require('vendor/task_list'); success: function(data, textStatus, jqXHR) { if ('id' in data) { $(document).trigger('issuable:change'); + const currentTotal = Number($('.issue_counter').text()); 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); } 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); } } else { new Flash(issueFailMessage, 'alert'); |