mirror of
https://github.com/bigchaindb/site.git
synced 2024-11-25 11:08:29 +01:00
Matthias Kretschmann
6ede38abfc
- start linting scss based on Airbnb style guide - add includePaths to css & js tasks
54 lines
1.2 KiB
JavaScript
54 lines
1.2 KiB
JavaScript
|
|
//=include vendor/jquery.ajaxchimp.js
|
|
|
|
var Newsletter = (function(w, d, $) {
|
|
|
|
'use strict';
|
|
|
|
var app, _private, _config;
|
|
|
|
_config = {
|
|
newsletter: $('#newsletter')
|
|
},
|
|
|
|
_private = {
|
|
ajaxChimp: function() {
|
|
_config.newsletter.ajaxChimp({
|
|
callback: formCallback
|
|
});
|
|
|
|
function formCallback (resp) {
|
|
if (resp.result === 'success') {
|
|
|
|
_config.newsletter.find('.input-group').addClass('hide');
|
|
|
|
// send GA event
|
|
if (!_dntEnabled()) {
|
|
GoogleAnalytics.gaEventNewsletterSuccess();
|
|
}
|
|
|
|
}
|
|
if (resp.result === 'error') {
|
|
_config.newsletter.find('.btn')
|
|
.removeClass('disabled')
|
|
.text('Subscribe');
|
|
|
|
// send GA event
|
|
if (!_dntEnabled()) {
|
|
GoogleAnalytics.gaEventNewsletterError();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
app = {
|
|
init: function() {
|
|
_private.ajaxChimp();
|
|
}
|
|
};
|
|
|
|
return app;
|
|
|
|
})(window, document, jQuery);
|