From 116ea651600cd7d7e500dbdb5192af93e957258d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 19 Feb 2021 17:57:38 +1100 Subject: [PATCH] Show / hide panels --- InvenTree/templates/InvenTree/index.html | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html index 3343eb3ce7..937bcf84e3 100644 --- a/InvenTree/templates/InvenTree/index.html +++ b/InvenTree/templates/InvenTree/index.html @@ -71,7 +71,7 @@ function addHeaderTitle(title) { function addHeaderAction(label, title, icon) { // Add an action block to the action list $("#action-item-list").append( - `
  • + `
  • ${title} @@ -81,6 +81,27 @@ function addHeaderAction(label, title, icon) {
  • ` ); + + // Add a detail item to the detail item-panel + $("#detail-item-list").append( + `
  • +

    ${title}

    +
    +
  • ` + ); + + $(`#detail-${label}`).hide(); + + $(`#action-${label}`).click(function() { + + // Hide all child elements + $('#detail-item-list').children('li').each(function() { + $(this).hide(); + }); + + // Show the one we want + $(`#detail-${label}`).show(); + }); } {% if roles.part.view %}