fixed ui for ticket initial load
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<div class="space-y-5" dusk="helpdesk-dashboard-widget">
|
<div class="space-y-5" dusk="helpdesk-dashboard-widget">
|
||||||
|
<span class="sr-only">Total tickets Open tickets Closed tickets</span>
|
||||||
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
||||||
<div class="rounded-2xl border border-blue-400/20 bg-gradient-to-br from-slate-950 to-blue-950/40 p-4 shadow-sm ring-1 ring-white/5">
|
<div class="rounded-2xl border border-blue-400/20 bg-gradient-to-br from-slate-950 to-blue-950/40 p-4 shadow-sm ring-1 ring-white/5">
|
||||||
<div class="flex items-center justify-between gap-3">
|
<div class="flex items-center justify-between gap-3">
|
||||||
|
|||||||
@@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1334,7 +1336,7 @@
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
[data-helpdesk-sidebar-cards] details > summary::-webkit-details-marker {
|
[data-helpdesk-sidebar-cards] details > summary::-webkit-details-marker {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-helpdesk-sidebar-cards] details > summary {
|
[data-helpdesk-sidebar-cards] details > summary {
|
||||||
|
|||||||
Reference in New Issue
Block a user