From 3996a702feaf087dda5f5a62767b988e221f32b7 Mon Sep 17 00:00:00 2001 From: Rob Cutmore Date: Sat, 9 Jul 2016 09:06:30 -0400 Subject: [PATCH] Clean up formatting of targets modal events --- static/js/app/users.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/static/js/app/users.js b/static/js/app/users.js index 14dc7d5d..0059a410 100644 --- a/static/js/app/users.js +++ b/static/js/app/users.js @@ -168,30 +168,30 @@ function load() { $(document).ready(function() { load() - // Setup the event listeners - // Handle manual additions + // Setup the event listeners + // Handle manual additions $("#targetForm").submit(function() { - targets.DataTable() - .row.add([ - escapeHtml($("#firstName").val()), - escapeHtml($("#lastName").val()), - escapeHtml($("#email").val()), - escapeHtml($("#position").val()), - '' - ]) - .draw() - $("#targetForm>div>input").val('') - $("#firstName").focus() - return false - }) - // Handle Deletion + targets.DataTable() + .row.add([ + escapeHtml($("#firstName").val()), + escapeHtml($("#lastName").val()), + escapeHtml($("#email").val()), + escapeHtml($("#position").val()), + '' + ]) + .draw(); + $("#targetForm>div>input").val(''); + $("#firstName").focus(); + return false; + }); + // Handle Deletion $("#targetsTable").on("click", "span>i.fa-trash-o", function() { targets.DataTable() .row($(this).parents('tr')) .remove() .draw(); - }) + }); $("#modal").on("hide.bs.modal", function() { - dismiss() - }) -}) + dismiss(); + }); +});