Automatic actions

This commit is contained in:
Frédéric Guillot
2014-03-09 23:21:23 -04:00
parent 7bd4697dfc
commit 7749b8ed56
49 changed files with 1678 additions and 190 deletions

View File

@@ -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));
}