1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

import optimizations for site.js

transfered pageIdOn and pageClassOn to clientUtils
This commit is contained in:
vitorsemeano 2020-11-09 00:14:33 +00:00
parent 5d94812220
commit 4e11e3ba66
9 changed files with 86 additions and 93 deletions

View file

@ -158,6 +158,26 @@ export function confirm(message, title, callback) {
});
}
export const pageClassOn = function(eventName, className, fn) {
document.addEventListener(eventName, function (event) {
const target = event.target;
if (target.classList.contains(className)) {
fn.call(target, event);
}
});
};
export const pageIdOn = function(eventName, id, fn) {
document.addEventListener(eventName, function (event) {
const target = event.target;
if (target.id === id) {
fn.call(target, event);
}
});
};
const Dashboard = {
alert,
capabilities,