diff options
Diffstat (limited to 'assets/js/board.js')
-rw-r--r-- | assets/js/board.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/assets/js/board.js b/assets/js/board.js index 33e47053..501c39c3 100644 --- a/assets/js/board.js +++ b/assets/js/board.js @@ -140,6 +140,23 @@ var xhr = new XMLHttpRequest(); xhr.open("POST", "?controller=board&action=save&project_id=" + projectId, true); + + xhr.onreadystatechange = function(response) { + + if (this.readyState == this.DONE) { + try { + var response = JSON.parse(this.responseText); + + if (response.result == true) { + + // TODO: don't refresh the whole page! + window.location = "?controller=board&action=show&project_id=" + projectId; + } + } + catch (e) {} + } + }; + xhr.send(JSON.stringify(data)); } |