mirror of
https://github.com/gophish/gophish
synced 2024-11-15 08:47:17 +00:00
Remove unnecessary code
Removed check and just always destroy and rebuild datatables.
This commit is contained in:
parent
22c2f659e8
commit
0bdc4a751d
1 changed files with 8 additions and 21 deletions
|
@ -112,8 +112,6 @@ function edit(idx){
|
||||||
$("#attachmentUpload").unbind('click').click(function(){this.value=null})
|
$("#attachmentUpload").unbind('click').click(function(){this.value=null})
|
||||||
$("#html_editor").ckeditor()
|
$("#html_editor").ckeditor()
|
||||||
$("#attachmentsTable").show()
|
$("#attachmentsTable").show()
|
||||||
attachmentsTable = null
|
|
||||||
if ( $.fn.dataTable.isDataTable('#attachmentsTable') ) {
|
|
||||||
attachmentsTable = $('#attachmentsTable').DataTable({
|
attachmentsTable = $('#attachmentsTable').DataTable({
|
||||||
destroy: true,
|
destroy: true,
|
||||||
"order": [[ 1, "asc" ]],
|
"order": [[ 1, "asc" ]],
|
||||||
|
@ -122,17 +120,6 @@ function edit(idx){
|
||||||
{ sClass: "datatable_hidden", targets:[3,4]}
|
{ sClass: "datatable_hidden", targets:[3,4]}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
|
||||||
else {
|
|
||||||
attachmentsTable = $("#attachmentsTable").DataTable({
|
|
||||||
destroy: true,
|
|
||||||
"order": [[ 1, "asc" ]],
|
|
||||||
columnDefs: [
|
|
||||||
{ orderable: false, targets: "no-sort" },
|
|
||||||
{ sClass: "datatable_hidden", targets:[3,4]}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var template = {attachments:[]}
|
var template = {attachments:[]}
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
template = templates[idx]
|
template = templates[idx]
|
||||||
|
|
Loading…
Reference in a new issue