# HG changeset patch # User neko259 # Date 2016-08-01 09:50:03 # Node ID db51ab04894eedc32c81d70d9fa1be46497594d4 # Parent 71e0e5666ec3042c99ba703e6a2aa3112be87309 Block the form when message is being sent diff --git a/boards/static/js/thread_update.js b/boards/static/js/thread_update.js --- a/boards/static/js/thread_update.js +++ b/boards/static/js/thread_update.js @@ -346,6 +346,7 @@ function updateOnPost(response, statusTe var status = json.status; showAsErrors(form, ''); + $('.post-form-w').unblock(); if (status === 'ok') { resetFormPosition(); @@ -438,7 +439,7 @@ function updateNodeAttr(oldNode, newNode if (form.length > 0) { var options = { beforeSubmit: function(arr, form, options) { - showAsErrors(form, gettext('Sending message...')); + $('.post-form-w').block({ message: gettext('Sending message...') }); }, success: updateOnPost, error: function(xhr, textStatus, errorString) { @@ -447,6 +448,7 @@ function updateNodeAttr(oldNode, newNode errorText += ' / ' + errorString; } showAsErrors(form, errorText); + $('.post-form-w').unblock(); }, url: '/api/add_post/' + threadId + '/', timeout: POST_AJAX_TIMEOUT