fixed ui for ticket initial load
This commit is contained in:
@@ -876,7 +876,16 @@
|
||||
function initialiseHelpdeskSidebarCards() {
|
||||
const sidebar = document.querySelector('[data-helpdesk-sidebar-cards]');
|
||||
|
||||
if (!sidebar || sidebar.dataset.helpdeskSidebarInitialised === 'true') {
|
||||
if (!sidebar) {
|
||||
return;
|
||||
}
|
||||
|
||||
sidebar.querySelectorAll('details[data-helpdesk-sidebar-card="true"]').forEach((details) => {
|
||||
details.open = false;
|
||||
details.removeAttribute('open');
|
||||
});
|
||||
|
||||
if (sidebar.dataset.helpdeskSidebarInitialised === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -893,7 +902,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const details = document.createElement('section');
|
||||
const details = document.createElement('details');
|
||||
const classNames = new Set(card.className.split(/\s+/).filter(Boolean));
|
||||
classNames.add('group');
|
||||
details.className = Array.from(classNames).join(' ');
|
||||
@@ -902,15 +911,7 @@
|
||||
|
||||
const summary = document.createElement('summary');
|
||||
summary.className = header.className;
|
||||
summary.classList.add(
|
||||
'flex',
|
||||
'cursor-pointer',
|
||||
'list-none',
|
||||
'items-center',
|
||||
'justify-between',
|
||||
'gap-3',
|
||||
'marker:hidden'
|
||||
);
|
||||
summary.classList.add('flex', 'cursor-pointer', 'list-none', 'items-center', 'justify-between', 'gap-3', 'marker:hidden');
|
||||
summary.classList.remove('mb-4');
|
||||
|
||||
while (header.firstChild) {
|
||||
@@ -933,6 +934,7 @@
|
||||
|
||||
details.appendChild(summary);
|
||||
details.appendChild(body);
|
||||
details.open = false;
|
||||
card.replaceWith(details);
|
||||
});
|
||||
}
|
||||
@@ -1334,7 +1336,7 @@
|
||||
|
||||
<style>
|
||||
[data-helpdesk-sidebar-cards] details > summary::-webkit-details-marker {
|
||||
|
||||
|
||||
}
|
||||
|
||||
[data-helpdesk-sidebar-cards] details > summary {
|
||||
|
||||
Reference in New Issue
Block a user