Fix regression: stay on the same page when a task is closed
This commit is contained in:
parent
10d96bfd66
commit
5315e4961e
|
|
@ -7,8 +7,9 @@ New features:
|
|||
|
||||
Improvements:
|
||||
|
||||
Bug fixes:
|
||||
Regressions:
|
||||
|
||||
* Stay on the same page when a task is closed
|
||||
|
||||
Version 1.0.37 (Jan 14, 2017)
|
||||
-----------------------------
|
||||
|
|
|
|||
|
|
@ -52,11 +52,11 @@ class TaskStatusController extends BaseController
|
|||
$this->flash->failure($failure_message);
|
||||
}
|
||||
|
||||
return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
|
||||
$this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
|
||||
} else {
|
||||
$this->response->html($this->template->render($template, array(
|
||||
'task' => $task,
|
||||
)));
|
||||
}
|
||||
|
||||
return $this->response->html($this->template->render($template, array(
|
||||
'task' => $task,
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -4,7 +4,7 @@ KB.component('confirm-buttons', function (containerElement, options) {
|
|||
function onSubmit() {
|
||||
isLoading = true;
|
||||
KB.find('#modal-confirm-button').replace(buildButton());
|
||||
window.location.href = options.url;
|
||||
KB.http.get(options.url);
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue