+
+
+
+
+
+
@@ -600,6 +627,47 @@
chevron.classList.toggle('rotate-180');
}
}
+
+ // Toggle Dropdown Menu Profil Pengguna di Pojok Kanan Atas
+ function toggleProfileDropdown() {
+ const dropdown = document.getElementById('userProfileDropdownMenu');
+ const chevron = document.getElementById('userProfileChevron');
+ const btn = document.getElementById('userProfileDropdownBtn');
+ if (dropdown) {
+ const isHidden = dropdown.classList.toggle('hidden');
+ if (btn) btn.setAttribute('aria-expanded', !isHidden);
+ }
+ if (chevron) {
+ chevron.classList.toggle('rotate-180');
+ }
+ }
+
+ // Tutup dropdown profil jika mengklik di luar area
+ document.addEventListener('click', function(event) {
+ const container = document.getElementById('userProfileContainer');
+ const dropdown = document.getElementById('userProfileDropdownMenu');
+ const chevron = document.getElementById('userProfileChevron');
+ const btn = document.getElementById('userProfileDropdownBtn');
+ if (container && dropdown && !container.contains(event.target)) {
+ dropdown.classList.add('hidden');
+ if (chevron) chevron.classList.remove('rotate-180');
+ if (btn) btn.setAttribute('aria-expanded', 'false');
+ }
+ });
+
+ // Tutup dropdown profil jika menekan tombol Escape
+ document.addEventListener('keydown', function(event) {
+ if (event.key === 'Escape') {
+ const dropdown = document.getElementById('userProfileDropdownMenu');
+ const chevron = document.getElementById('userProfileChevron');
+ const btn = document.getElementById('userProfileDropdownBtn');
+ if (dropdown && !dropdown.classList.contains('hidden')) {
+ dropdown.classList.add('hidden');
+ if (chevron) chevron.classList.remove('rotate-180');
+ if (btn) btn.setAttribute('aria-expanded', 'false');
+ }
+ }
+ });
@yield('scripts')