Skip to content

Commit

Permalink
Fixed newsletter JS
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsifra committed Oct 26, 2015
1 parent a1e111c commit 37d4fb5
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions www/assets/admin/scripts/custom/newsletter.js
Expand Up @@ -3,15 +3,19 @@ var Newsletter = Newsletter || {};

Newsletter.init = function () {
var e = document.getElementById('new-newsletter-data');
var data = JSON.parse(e.textContent || e.innerHTML);


if (e) {
var data = JSON.parse(e.textContent || e.innerHTML);

$(document).on('change', '#new-newsletter-locale', function () {
if ($('#new-newsletter-recipients').val() === 'u') {
$('#new-newsletter-count').text(data[$('#new-newsletter-locale').val()]);
}
});
}


$(document).on('change', '#new-newsletter-recipients', function () {
$('#new-newsletter-validate').click();
});

$(document).on('change', '#new-newsletter-locale', function () {
if ($('#new-newsletter-recipients').val() === 'u') {
$('#new-newsletter-count').text(data[$('#new-newsletter-locale').val()]);
}
});
};

0 comments on commit 37d4fb5

Please sign in to comment.