diff --git a/themes/community-theme-16/js/modules/blocknewsletter/blocknewsletter.js b/themes/community-theme-16/js/modules/blocknewsletter/blocknewsletter.js index 8e6b864c..3fd3d74e 100644 --- a/themes/community-theme-16/js/modules/blocknewsletter/blocknewsletter.js +++ b/themes/community-theme-16/js/modules/blocknewsletter/blocknewsletter.js @@ -1,22 +1,33 @@ -$(document).ready(function() { +$(function() { + + $('#blocknewsletter').find('form').on('submit', function () { + $(this).addClass('loading-overlay'); + }); $('#newsletter-input').on({ focus: function() { - if ($(this).val() == placeholder_blocknewsletter || $(this).val() == msg_newsl) + if ($(this).val() == placeholder_blocknewsletter || $(this).val() == msg_newsl) { $(this).val(''); + } }, blur: function() { - if ($(this).val() == '') + if ($(this).val() == '') { $(this).val(placeholder_blocknewsletter); + } } }); - var cssClass = 'alert alert-danger'; - if (typeof nw_error != 'undefined' && !nw_error) - cssClass = 'alert alert-success'; + var alertClass = 'alert alert-danger'; + if (typeof nw_error != 'undefined' && !nw_error) { + alertClass = 'alert alert-success'; + } if (typeof msg_newsl != 'undefined' && msg_newsl) { - $('#columns').prepend('

' + alert_blocknewsletter + '

'); - $('html, body').animate({scrollTop: $('#columns').offset().top}, 'slow'); + var $cols = $('#columns'); + $cols.prepend('
' + alert_blocknewsletter + '
'); + $('html, body').animate({ + scrollTop: $cols.offset().top + }, 'slow'); } + }); diff --git a/themes/community-theme-16/modules/blocknewsletter/blocknewsletter.tpl b/themes/community-theme-16/modules/blocknewsletter/blocknewsletter.tpl index 2bda160d..7e2508d3 100644 --- a/themes/community-theme-16/modules/blocknewsletter/blocknewsletter.tpl +++ b/themes/community-theme-16/modules/blocknewsletter/blocknewsletter.tpl @@ -3,7 +3,7 @@
- +