diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-01-23 21:05:59 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-01-23 21:05:59 -0500 |
commit | 5315e4961e3628a04d19440a3dceca9ecc2acb82 (patch) | |
tree | 2bbe1edc644ecb881dfe955b96b1da4b51aa26c3 /assets/js/core | |
parent | 10d96bfd668f445249190c52bedb2eb0e7e9410d (diff) |
Fix regression: stay on the same page when a task is closed
Diffstat (limited to 'assets/js/core')
-rw-r--r-- | assets/js/core/http.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/assets/js/core/http.js b/assets/js/core/http.js index 21200a0f..745435cc 100644 --- a/assets/js/core/http.js +++ b/assets/js/core/http.js @@ -4,6 +4,7 @@ KB.http.request = function (method, url, headers, body) { function parseResponse(request) { var redirect = request.getResponseHeader('X-Ajax-Redirect'); + var location = request.getResponseHeader('Location'); if (redirect === 'self') { window.location.reload(); @@ -11,6 +12,8 @@ KB.http.request = function (method, url, headers, body) { window.location = redirect.split('#')[0]; } else if (redirect) { window.location = redirect; + } else if (location) { + window.location = location; } else if (request.getResponseHeader('Content-Type') === 'application/json') { try { return JSON.parse(request.responseText); |