Fixed bug when copying campaign.

Fixes #549
Fixes #898
1205-drop-campaigns
Jordan Wright 2018-10-03 15:00:08 -05:00
parent c9e800dda7
commit a0c1860a0a
2 changed files with 7 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -254,21 +254,24 @@ function copy(idx) {
placeholder: campaign.template.name placeholder: campaign.template.name
}); });
} else { } else {
$("#template").select2("val", campaign.template.id.toString()); $("#template").val(campaign.template.id.toString());
$("#template").trigger("change.select2")
} }
if (!campaign.page.id) { if (!campaign.page.id) {
$("#page").select2({ $("#page").select2({
placeholder: campaign.page.name placeholder: campaign.page.name
}); });
} else { } else {
$("#page").select2("val", campaign.page.id.toString()); $("#page").val(campaign.page.id.toString());
$("#page").trigger("change.select2")
} }
if (!campaign.smtp.id) { if (!campaign.smtp.id) {
$("#profile").select2({ $("#profile").select2({
placeholder: campaign.smtp.name placeholder: campaign.smtp.name
}); });
} else { } else {
$("#profile").select2("val", campaign.smtp.id.toString()); $("#profile").val(campaign.smtp.id.toString());
$("#profile").trigger("change.select2")
} }
$("#url").val(campaign.url) $("#url").val(campaign.url)
}) })