diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue index b33747382b..778d0d35bf 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue @@ -266,11 +266,6 @@ export default { }, agreement_table_settings, 1) }, - destroy_table: function () { - $('#agreement_list') - .DataTable() - .destroy(true) - }, }, mounted() { if (!this.building_table) { @@ -279,8 +274,11 @@ export default { } }, beforeUnmount() { - // This delays the closing of the modal, do we really need it? - //this.destroy_table() + if ($.fn.DataTable.isDataTable('#agreement_list')) { + $('#agreement_list') + .DataTable() + .destroy(true) + } }, components: { Toolbar }, name: "AgreementsList", diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOPackagesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOPackagesList.vue index 2f437697a8..458d54d823 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOPackagesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOPackagesList.vue @@ -243,7 +243,7 @@ export default { }, }, beforeUnmount() { - if (!$.fn.DataTable.isDataTable('#package_list')) { + if ($.fn.DataTable.isDataTable('#package_list')) { $('#package_list') .DataTable() .destroy(true) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlePackagesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlePackagesList.vue index 0d734a6436..70e5d16e2d 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlePackagesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlePackagesList.vue @@ -136,9 +136,11 @@ export default { this.build_datatable() }, beforeUnmount() { - $('#package_list') - .DataTable() - .destroy(true) + if ($.fn.DataTable.isDataTable('#package_list')) { + $('#package_list') + .DataTable() + .destroy(true) + } }, props: { resources: Array, diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue index cc13a59719..3b03ff5fc9 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue @@ -259,7 +259,7 @@ export default { }, }, beforeUnmount() { - if ( ! $.fn.DataTable.isDataTable( '#title_list' ) ) { + if ($.fn.DataTable.isDataTable('#title_list')) { $('#title_list') .DataTable() .destroy(true) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageTitlesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageTitlesList.vue index 73c68383b8..ecbc94a0da 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageTitlesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageTitlesList.vue @@ -98,9 +98,11 @@ export default { this.build_datatable() }, beforeUnmount() { - $('#title_list') - .DataTable() - .destroy(true) + if ($.fn.DataTable.isDataTable('#title_list')) { + $('#title_list') + .DataTable() + .destroy(true) + } }, props: { package_id: String, diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesList.vue index b56613504a..4759f3dd17 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesList.vue @@ -211,7 +211,7 @@ export default { }, }, beforeUnmount() { - if (!$.fn.DataTable.isDataTable('#package_list')) { + if ($.fn.DataTable.isDataTable('#package_list')) { $('#package_list') .DataTable() .destroy(true) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue index e655f9891b..30bf8093b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue @@ -70,9 +70,11 @@ export default { this.build_datatable() }, beforeUnmount() { - $('#package_list') - .DataTable() - .destroy(true) + if ($.fn.DataTable.isDataTable('#package_list')) { + $('#package_list') + .DataTable() + .destroy(true) + } }, props: { resources: Array, diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue index 045b2c051f..9cd5023cbd 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue @@ -201,7 +201,7 @@ export default { }, }, beforeUnmount() { - if (!$.fn.DataTable.isDataTable('#title_list')) { + if ($.fn.DataTable.isDataTable('#title_list')) { $('#title_list') .DataTable() .destroy(true)