summaryrefslogtreecommitdiff
path: root/addons/website/static
diff options
context:
space:
mode:
authorDharmraj Jhala <dja@openerp.com>2015-06-17 14:31:25 +0530
committerChristophe Matthieu <chm@odoo.com>2015-06-17 12:51:47 +0200
commitbc43417b186c9e05f178127ebf511f8a80d005f6 (patch)
tree7edaf26f83685219eea1fbfff40458cae8e0d48f /addons/website/static
parent77eca089d1697f1bbf7b5df32530f0bd9719eaab (diff)
[IMP] website_* Post button improved : Prevented posting to server multiple times
Diffstat (limited to 'addons/website/static')
-rw-r--r--addons/website/static/src/js/website.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js
index 6e3ef66ab30..4f56cee63cc 100644
--- a/addons/website/static/src/js/website.js
+++ b/addons/website/static/src/js/website.js
@@ -380,6 +380,13 @@ dom_ready.then(function () {
init_kanban(this);
});
+ $('.js_website_submit_form').on('submit', function() {
+ var $buttons = $(this).find('button[type="submit"], a.a-submit');
+ _.each($buttons, function(btn) {
+ $(btn).attr('data-loading-text', '<i class="fa fa-spinner fa-spin"></i> ' + $(btn).text()).button('loading');
+ });
+ });
+
setTimeout(function () {
if (window.location.hash.indexOf("scrollTop=") > -1) {
window.document.body.scrollTop = +location.hash.match(/scrollTop=([0-9]+)/)[1];