admin dashboard early UI refresh
This commit is contained in:
parent
028ed60293
commit
13a84f7f25
12 changed files with 249 additions and 139 deletions
|
|
@ -69,3 +69,20 @@ export function makeMagicList(container, itemSelector, callback) {
|
|||
if (callback) callback();
|
||||
});
|
||||
}
|
||||
|
||||
export function hijackClickEvent(container, link) {
|
||||
container.addEventListener('click', event => {
|
||||
if (event.target.tagName.toLowerCase() === 'a') return;
|
||||
event.preventDefault();
|
||||
link.dispatchEvent(new MouseEvent('click', {
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
view: window,
|
||||
ctrlKey: event.ctrlKey,
|
||||
metaKey: event.metaKey,
|
||||
shiftKey: event.shiftKey,
|
||||
altKey: event.altKey,
|
||||
button: event.button,
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue