Clean up formatting of targets modal events

pull/320/head
Rob Cutmore 2016-07-09 09:06:30 -04:00
parent 5cdfcbfe37
commit 3996a702fe
1 changed files with 20 additions and 20 deletions

View File

@ -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()),
'<span style="cursor:pointer;"><i class="fa fa-trash-o"></i></span>'
])
.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()),
'<span style="cursor:pointer;"><i class="fa fa-trash-o"></i></span>'
])
.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();
});
});