feat(notification): add admin rest management and deletion
Add revision-safe service and template APIs, channel mapping, and validated admin controls. Ref: IT-1601
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// Reveal keyboard-focused controls only within their nearest horizontal table scroller.
|
||||
(() => {
|
||||
let keyboardFocus = false;
|
||||
document.addEventListener('keydown', () => { keyboardFocus = true; }, true);
|
||||
document.addEventListener('pointerdown', () => { keyboardFocus = false; }, true);
|
||||
document.addEventListener('focusin', event => {
|
||||
const target = event.target;
|
||||
if (!keyboardFocus || !(target instanceof HTMLElement) || !target.closest('.admin-data-table')) return;
|
||||
const wrapper = target.closest('.table-responsive');
|
||||
if (!wrapper) return;
|
||||
const control = target.getBoundingClientRect();
|
||||
const viewport = wrapper.getBoundingClientRect();
|
||||
// Leave space for the focus ring without moving the document or vertical ancestors.
|
||||
const left = viewport.left + wrapper.clientLeft + 8;
|
||||
const right = left + wrapper.clientWidth - 16;
|
||||
if (control.left < left) wrapper.scrollLeft += control.left - left;
|
||||
else if (control.right > right) wrapper.scrollLeft += control.right - right;
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user