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