mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Show / hide panels
This commit is contained in:
parent
6df6a460e4
commit
116ea65160
@ -71,7 +71,7 @@ function addHeaderTitle(title) {
|
|||||||
function addHeaderAction(label, title, icon) {
|
function addHeaderAction(label, title, icon) {
|
||||||
// Add an action block to the action list
|
// Add an action block to the action list
|
||||||
$("#action-item-list").append(
|
$("#action-item-list").append(
|
||||||
`<li class='list-group-item' id='action-${title}'>
|
`<li class='list-group-item' id='action-${label}'>
|
||||||
<a href='#'>
|
<a href='#'>
|
||||||
<span class='fas ${icon}'></span>
|
<span class='fas ${icon}'></span>
|
||||||
${title}
|
${title}
|
||||||
@ -81,6 +81,27 @@ function addHeaderAction(label, title, icon) {
|
|||||||
</span>
|
</span>
|
||||||
</li>`
|
</li>`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Add a detail item to the detail item-panel
|
||||||
|
$("#detail-item-list").append(
|
||||||
|
`<li class='list-group-item' id='detail-${label}'>
|
||||||
|
<h4>${title}</h4>
|
||||||
|
<div id='data-${label}'></div>
|
||||||
|
</li>`
|
||||||
|
);
|
||||||
|
|
||||||
|
$(`#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 %}
|
{% if roles.part.view %}
|
||||||
|
Loading…
Reference in New Issue
Block a user