mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-22 15:56:17 -04:00
Defer loading of all render-blocking resources until the UI has loaded
This commit is contained in:
parent
778d49e84b
commit
99332037bf
12 changed files with 1447 additions and 1385 deletions
17
public/scripts/util-main.js
Normal file
17
public/scripts/util-main.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
// Selector shortcuts
|
||||
const $ = query => document.getElementById(query);
|
||||
const $$ = query => document.querySelector(query);
|
||||
|
||||
class Events {
|
||||
static fire(type, detail = {}) {
|
||||
window.dispatchEvent(new CustomEvent(type, { detail: detail }));
|
||||
}
|
||||
|
||||
static on(type, callback, options) {
|
||||
return window.addEventListener(type, callback, options);
|
||||
}
|
||||
|
||||
static off(type, callback, options) {
|
||||
return window.removeEventListener(type, callback, options);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue