Skip to content

Commit

Permalink
Refine the display toggle of the pagination elements #3
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Dec 21, 2023
1 parent bb49b53 commit 33902a8
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions product_portfolio/templates/product_portfolio/product_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<td colspan="100">' +
Expand All @@ -246,6 +258,7 @@
if (!row.classList.contains("extra-details")) {
row.style.display = '';
}
showPagination();
});
return false;
});
Expand All @@ -255,6 +268,7 @@
if (!row.classList.contains("new-version")) {
row.style.display = 'none';
}
hidePagination();
});
return false;
});
Expand Down

0 comments on commit 33902a8

Please sign in to comment.