Archived
1
0

show "posting..." message right before posting

This commit is contained in:
Jeff Becker
2016-05-01 17:25:08 -04:00
parent 187eef590d
commit ba045b6903
2 changed files with 4 additions and 3 deletions

View File

@@ -245,6 +245,7 @@ DynReply.prototype.showError = function(msg) {
DynReply.prototype.showMessage = function(msg) {
this._error.setAttribute("class", "message");
this._error.innerHTML = "";
this._error.appendChild(document.createTextNode(msg));
var e = this._error;
setTimeout(function() {
@@ -377,6 +378,7 @@ function init(prefix) {
var f = document.querySelector("form");
// do ajax request to post data
var r = getReplyTo();
r.showMessage("posting... ");
r.post(function(j) {
if(j.error) {
// an error happened
@@ -391,7 +393,6 @@ function init(prefix) {
r.showError(err);
r.clearSolution();
});
r.showMessage("posting... ");
}
e.onclick = postit;
var f = document.querySelector("form");