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

update subtitle escaping

This commit is contained in:
Luke Pulverenti 2015-08-16 11:53:30 -04:00
parent e97b2577b7
commit c5fce6d083
79 changed files with 408 additions and 247 deletions

View file

@ -26,7 +26,10 @@
*/
var $w = $(window);
function visibleInViewport(elem, partial, hidden, direction, threshold) {
var thresholdX = Math.max(screen.availWidth * 2, 1000);
var thresholdY = Math.max(screen.availHeight * 2, 1000);
function visibleInViewport(elem, partial, hidden, direction) {
var t = elem,
vpWidth = $w.width(),
@ -38,10 +41,10 @@
// Use this native browser method, if available.
var rec = t.getBoundingClientRect(),
tViz = rec.top >= 0 && rec.top < vpHeight + threshold,
bViz = rec.bottom > 0 && rec.bottom <= vpHeight + threshold,
lViz = rec.left >= 0 && rec.left < vpWidth + threshold,
rViz = rec.right > 0 && rec.right <= vpWidth + threshold,
tViz = rec.top >= 0 && rec.top < vpHeight + thresholdY,
bViz = rec.bottom > 0 && rec.bottom <= vpHeight + thresholdY,
lViz = rec.left >= 0 && rec.left < vpWidth + thresholdX,
rViz = rec.right > 0 && rec.right <= vpWidth + thresholdX,
vVisible = partial ? tViz || bViz : tViz && bViz,
hVisible = partial ? lViz || rViz : lViz && rViz;
@ -79,18 +82,8 @@
var unveilId = 0;
function getThreshold() {
var screens = $.browser.mobile ? 2.5 : 1;
// This helps eliminate the draw-in effect as you scroll
return Math.max(screen.availHeight * screens, 1000);
}
var threshold = getThreshold();
function isVisible(elem) {
return visibleInViewport(elem, true, false, 'both', threshold);
return visibleInViewport(elem, true, false, 'both');
}
function fillImage(elem) {