Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

[*] FO: Add loading overlay to blocknewsletter #204

Merged
merged 4 commits into from
May 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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('<div class="clearfix"></div><p class="' + cssClass + '"> ' + alert_blocknewsletter + '</p>');
$('html, body').animate({scrollTop: $('#columns').offset().top}, 'slow');
var $cols = $('#columns');
$cols.prepend('<div class="' + alertClass + '">' + alert_blocknewsletter + '</div>');
$('html, body').animate({
scrollTop: $cols.offset().top
}, 'slow');
}

});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<form action="{$link->getPageLink('index', null, null, null, false, null, true)|escape:'html':'UTF-8'}" method="post">
<div class="form-group{if isset($msg) && $msg } {if $nw_error}form-error{else}form-ok{/if}{/if}" >
<div class="input-group">
<input class="form-control" id="newsletter-input" type="text" name="email" size="18" value="{if isset($msg) && $msg}{$msg}{elseif isset($value) && $value}{$value}{else}{l s='Enter your e-mail' mod='blocknewsletter'}{/if}" />
<input class="form-control" id="newsletter-input" type="email" name="email" size="18" value="{if isset($msg) && $msg}{$msg}{elseif isset($value) && $value}{$value}{else}{l s='Enter your e-mail' mod='blocknewsletter'}{/if}"/>
<span class="input-group-btn">
<button type="submit" name="submitNewsletter" class="btn btn-primary">
<i class="icon icon-chevron-right"></i>
Expand Down