chore: update templ and templui
This commit is contained in:
parent
b5d195baea
commit
61eaa268ab
89 changed files with 25776 additions and 8231 deletions
20
assets/js/dropdown.js
Normal file
20
assets/js/dropdown.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
document.addEventListener('click', (e) => {
|
||||
const item = e.target.closest('[data-tui-dropdown-item]');
|
||||
if (!item ||
|
||||
item.hasAttribute('data-tui-dropdown-submenu-trigger') ||
|
||||
item.getAttribute('data-tui-dropdown-prevent-close') === 'true') return;
|
||||
|
||||
const popoverRoot = item.closest('[data-tui-popover-root]');
|
||||
const popoverContent = popoverRoot?.querySelector(':scope > [data-tui-popover-content]');
|
||||
if (!popoverContent?.matches(':popover-open')) return;
|
||||
|
||||
try {
|
||||
popoverContent.hidePopover();
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
});
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue