Make sure all frequency changes are displayed correctly

[MAILPOET-953]
This commit is contained in:
Pavel Dohnal
2017-07-05 16:29:22 +01:00
parent 6b7bc8a731
commit 94d57b5287

View File

@@ -768,12 +768,11 @@
});
$('#mailpoet_smtp_method').on('change keyup', renderHostsSelect);
$('#mailpoet_sending_frequency').on('change keyup', sendingFrequencyMethodUpdated);
$('#mailpoet_smtp_method').trigger("change");
$('#other_frequency_emails').trigger("change");
function saveSendingMethodConfiguration(group) {
var emails = $('#'+group+'_frequency_emails').val(),
interval = $('#'+group+'_frequency_interval').val();
// set sending method
if(group === undefined) {
MailPoet.Notice.error(
@@ -783,10 +782,6 @@
// set new sending method active
setSendingMethodGroup(group);
// update sending frequency values
$('#mta_frequency_emails').val(emails);
$('#mta_frequency_interval').val(interval);
// enforce signup confirmation depending on selected group
setSignupConfirmation(group);
@@ -920,10 +915,17 @@
function sendingFrequencyMethodUpdated() {
var method = $(this).find('option:selected').first();
var sendingMethod = $('#mailpoet_smtp_method').find('option:selected').first().val();
if(method.val() === "manual") {
$('#mailpoet_sending_frequency_manual').show();
$('#mailpoet_recommended_daily_emails').hide();
$('#other_frequency_emails').trigger("change");
} else {
$('#mailpoet_sending_frequency_manual').hide();
if(sendingMethod !== "server") {
$('#mailpoet_recommended_daily_emails').show();
}
$('#mailpoet_smtp_method').trigger("change");
}
}
@@ -966,6 +968,11 @@
}
var emails = method.data('emails');
var interval = method.data('interval');
if(val === "server") {
var emails = $('#mailpoet_web_host').find('option:selected').first().data('emails');
var interval = $('#mailpoet_web_host').find('option:selected').first().data('interval');
}
setSendingFrequency({
output: '#mailpoet_recommended_daily_emails',
only_daily: false,