$( function() {
$( '.div-follow .btn-follow' ).on('click', function(e){
e.preventDefault();
div_follow = $(this).parents().find('.div-follow')[0];
form_follow = $(div_follow).find('.form-follow')[0];
$(this).animate({
'width':'0',
'padding-left':'toggle',
'padding-right':'toggle'
}, function(){
$(this).hide();
$(form_follow).show();
$(form_follow).find('input[type=email]').focus();
}
);
});
$('[data-loading-text]').button();
$('[data-loading-text]').on('click', function(){
$(this).button('loading');
});
$('.btn-follow').tooltip();
follow_div = $('.div-follow');
follow_form = $('.form-follow');
form_follow_error = $('.form-follow-error')
follow_form.submit(function(e){
$.ajax({
url: follow_form.attr('action'),
type: follow_form.attr('method'),
data: follow_form.serialize(),
dataType: 'json'