From 78f378fc28aa92c013f988cae189dd5b8c098c97 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Mon, 29 Feb 2016 21:20:46 -0600 Subject: [PATCH] Added better handling of the "Include Tracking Image" option --- static/js/app/templates.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/static/js/app/templates.js b/static/js/app/templates.js index 72818255..2d962673 100644 --- a/static/js/app/templates.js +++ b/static/js/app/templates.js @@ -28,6 +28,9 @@ function save(idx) { template.html.indexOf("{{.Tracker}}") == -1 && template.html.indexOf("{{.TrackingUrl}}") == -1) { template.html = template.html.replace("", "{{.Tracker}}") + } else { + // Otherwise, remove the tracker + template.html = template.html.replace("{{.Tracker}}", "") } template.text = $("#text_editor").val() // Add the attachments @@ -157,6 +160,11 @@ function edit(idx) { file.type || "application/octet-stream" ]).draw() }) + if (template.html.indexOf("{{.Tracker}}") != -1) { + $("#use_tracker_checkbox").prop("checked", true) + } else { + $("#use_tracker_checkbox").prop("checked", false) + } } // Handle Deletion $("#attachmentsTable").unbind('click').on("click", "span>i.fa-trash-o", function() { @@ -322,7 +330,7 @@ $(document).ready(function() { }, this)); }; $('#modal').on('hidden.bs.modal', function(event) { - dismiss() + dismiss() }); load() })