diff --git a/product_portfolio/templates/product_portfolio/product_details.html b/product_portfolio/templates/product_portfolio/product_details.html index 96fe1ce..5a38c1d 100644 --- a/product_portfolio/templates/product_portfolio/product_details.html +++ b/product_portfolio/templates/product_portfolio/product_details.html @@ -214,14 +214,26 @@ let checkPackageLink = this; checkPackageLink.classList.add("disabled"); + const tabContentPaginations = document.querySelectorAll(".tab-content .pagination"); + + function hidePagination(data) { + tabContentPaginations.forEach(function(element) { + element.style.display = 'none'; } + ); + } + + function showPagination(data) { + tabContentPaginations.forEach(function(element) { + element.style.display = ''; } + ); + } + + hidePagination(); + document.querySelectorAll("#tab_inventory tbody tr").forEach(function (row) { row.style.display = 'none'; }); - document.querySelectorAll(".tab-content .pagination").forEach(function(element) { - element.parentNode.removeChild(element); - }); - let newVersionRow = document.createElement('tr'); newVersionRow.className = 'spinner new-version'; newVersionRow.innerHTML = '' + @@ -246,6 +258,7 @@ if (!row.classList.contains("extra-details")) { row.style.display = ''; } + showPagination(); }); return false; }); @@ -255,6 +268,7 @@ if (!row.classList.contains("new-version")) { row.style.display = 'none'; } + hidePagination(); }); return false; });