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

@ -223,7 +223,7 @@
$('.alphabetPicker', page).alphaValue(query.NameStartsWith);
}
pageIdOn.on('pageinit', "channelItemsPage", function () {
pageIdOn('pageinit', "channelItemsPage", function () {
var page = this;

View file

@ -160,9 +160,9 @@
var requiresControls = !MediaPlayer.canAutoPlayAudio();
if (requiresControls) {
html += '<div class="mediaPlayerAudioContainer"><div class="mediaPlayerAudioContainerInner">';;
html += '<div class="mediaPlayerAudioContainer" style="position: fixed;top: 40%;text-align: center;left: 0;right: 0;"><div class="mediaPlayerAudioContainerInner">';;
} else {
html += '<div class="mediaPlayerAudioContainer" style="display:none;"><div class="mediaPlayerAudioContainerInner">';;
html += '<div class="mediaPlayerAudioContainer" style="display:none;padding: 1em;background: #222;"><div class="mediaPlayerAudioContainerInner">';;
}
html += '<audio class="mediaPlayerAudio" crossorigin="anonymous" controls>';

View file

@ -674,6 +674,8 @@
function ensureVideoPlayerElements() {
Dashboard.importCss('css/mediaplayer-video.css');
var html = '<div id="mediaPlayer" style="display: none;">';
html += '<div class="videoBackdrop">';
@ -745,7 +747,6 @@
var div = document.createElement('div');
div.innerHTML = html;
document.body.appendChild(div);
$(div).trigger('create');
}
Dashboard.ready(function () {

View file

@ -764,6 +764,7 @@
var page = this;
Dashboard.importCss('css/nowplaying.css');
bindEvents(page);
$('.sendMessageForm').off('submit', NowPlayingPage.onMessageSubmit).on('submit', NowPlayingPage.onMessageSubmit);

View file

@ -6,6 +6,7 @@
self.show = function () {
Dashboard.importCss('css/search.css');
$('.headerSearchInput').val('');
require(["jquery", "velocity"], function ($, Velocity) {

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();
}
});
});