diff options
author | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-03-09 23:21:23 -0400 |
---|---|---|
committer | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-03-09 23:21:23 -0400 |
commit | 7749b8ed569f6d27b0bb2ed4c2040e8b61ed4422 (patch) | |
tree | ee101992e87d740bdf0362e35ea040c866986f5a /assets/js/board.js | |
parent | 7bd4697dfca41a21f5857f83d6b29108fafb9a1e (diff) |
Automatic actions
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)); } |