##// END OF EJS Templates
Block the form when message is being sent
neko259 -
r1637:db51ab04 default
parent child Browse files
Show More
@@ -346,6 +346,7 b' function updateOnPost(response, statusTe'
346 var status = json.status;
346 var status = json.status;
347
347
348 showAsErrors(form, '');
348 showAsErrors(form, '');
349 $('.post-form-w').unblock();
349
350
350 if (status === 'ok') {
351 if (status === 'ok') {
351 resetFormPosition();
352 resetFormPosition();
@@ -438,7 +439,7 b' function updateNodeAttr(oldNode, newNode'
438 if (form.length > 0) {
439 if (form.length > 0) {
439 var options = {
440 var options = {
440 beforeSubmit: function(arr, form, options) {
441 beforeSubmit: function(arr, form, options) {
441 showAsErrors(form, gettext('Sending message...'));
442 $('.post-form-w').block({ message: gettext('Sending message...') });
442 },
443 },
443 success: updateOnPost,
444 success: updateOnPost,
444 error: function(xhr, textStatus, errorString) {
445 error: function(xhr, textStatus, errorString) {
@@ -447,6 +448,7 b' function updateNodeAttr(oldNode, newNode'
447 errorText += ' / ' + errorString;
448 errorText += ' / ' + errorString;
448 }
449 }
449 showAsErrors(form, errorText);
450 showAsErrors(form, errorText);
451 $('.post-form-w').unblock();
450 },
452 },
451 url: '/api/add_post/' + threadId + '/',
453 url: '/api/add_post/' + threadId + '/',
452 timeout: POST_AJAX_TIMEOUT
454 timeout: POST_AJAX_TIMEOUT
General Comments 0
You need to be logged in to leave comments. Login now