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

strip unused css from initial download

This commit is contained in:
Luke Pulverenti 2015-11-27 13:24:44 -05:00
parent 6a9accf68f
commit 2d014a82b4
10 changed files with 82 additions and 108 deletions

View file

@ -1924,9 +1924,26 @@ var AppInfo = {};
tapDelay: 0
});
function parentWithClass(elem, className) {
while (!elem.classList || !elem.classList.contains(className)) {
elem = elem.parentNode;
if (!elem) {
return null;
}
}
return elem;
}
// Have to work around this issue of fast click breaking the panel dismiss
$(document.body).on('touchstart', '.ui-panel-dismiss', function () {
$(this).trigger('click');
document.body.addEventListener('touchstart', function (e) {
var tgt = parentWithClass(e.target, 'ui-panel-dismiss');
if (tgt) {
$(tgt).click();
}
});
});