Added better handling of the "Include Tracking Image" option

pull/186/head
Jordan Wright 2016-02-29 21:20:46 -06:00
parent 8a3f990d1f
commit 78f378fc28
1 changed files with 9 additions and 1 deletions

View File

@ -28,6 +28,9 @@ function save(idx) {
template.html.indexOf("{{.Tracker}}") == -1 && template.html.indexOf("{{.Tracker}}") == -1 &&
template.html.indexOf("{{.TrackingUrl}}") == -1) { template.html.indexOf("{{.TrackingUrl}}") == -1) {
template.html = template.html.replace("</body>", "{{.Tracker}}</body>") template.html = template.html.replace("</body>", "{{.Tracker}}</body>")
} else {
// Otherwise, remove the tracker
template.html = template.html.replace("{{.Tracker}}</body>", "</body>")
} }
template.text = $("#text_editor").val() template.text = $("#text_editor").val()
// Add the attachments // Add the attachments
@ -157,6 +160,11 @@ function edit(idx) {
file.type || "application/octet-stream" file.type || "application/octet-stream"
]).draw() ]).draw()
}) })
if (template.html.indexOf("{{.Tracker}}</body>") != -1) {
$("#use_tracker_checkbox").prop("checked", true)
} else {
$("#use_tracker_checkbox").prop("checked", false)
}
} }
// Handle Deletion // Handle Deletion
$("#attachmentsTable").unbind('click').on("click", "span>i.fa-trash-o", function() { $("#attachmentsTable").unbind('click').on("click", "span>i.fa-trash-o", function() {