delay height calculation

This commit is contained in:
j 2022-09-26 21:54:50 +01:00
parent 27562973e7
commit f39f854821
3 changed files with 36 additions and 16 deletions

View file

@ -61,13 +61,6 @@ main {
line-height: 1.2em; line-height: 1.2em;
} }
i {
font-style: italic;
}
b {
font-weight: bold;
}
nav { nav {
a { a {

View file

@ -30,7 +30,13 @@
font-weight: 700; font-weight: 700;
font-style: normal; font-style: normal;
} }
@font-face {
font-family: 'noto_sans';
src: url('../../static/fonts/noto-sans/noto-sans-bold-webfont.woff2') format('woff2'),
url('../../static/fonts/noto-sans/noto-sans-bold-webfont.woff') format('woff');
font-weight: 700;
font-style: bold;
}
@font-face { @font-face {
font-family: 'noto_sans'; font-family: 'noto_sans';
src: url('noto-sans-bold-italic-webfont.woff2') format('woff2'), src: url('noto-sans-bold-italic-webfont.woff2') format('woff2'),
@ -38,6 +44,14 @@
font-weight: 700; font-weight: 700;
font-style: italic; font-style: italic;
} }
@font-face {
font-family: 'noto_sans';
src: url('noto-sans-bold-italic-webfont.woff2') format('woff2'),
url('noto-sans-bold-italic-webfont.woff') format('woff');
font-weight: 700;
font-style: bold italic;
}
// Text: Global Classes // Text: Global Classes
@ -52,6 +66,14 @@ strong {
em { em {
font-style: italic; font-style: italic;
} }
i {
font-style: italic;
}
b {
font-weight: bold;
font-weight: 700;
}
.font-size-sm { .font-size-sm {
font-size: 18px; font-size: 18px;

View file

@ -445,14 +445,19 @@ function renderSingleMode(config) {
annot.style.position = 'absolute' annot.style.position = 'absolute'
text.appendChild(annot) text.appendChild(annot)
}) })
var height = 0 if (config.annotations.length) {
text.querySelectorAll('.annotation.single').forEach(annotation => { text.style.height = '72px';
var rect = annotation.getBoundingClientRect() }
if (rect.height > height) { setTimeout(() => {
height = rect.height var height = 0
} text.querySelectorAll('.annotation.single').forEach(annotation => {
}) var rect = annotation.getBoundingClientRect()
text.style.height = height + 'px'; if (rect.height > height) {
height = rect.height
}
})
text.style.height = height + 'px';
}, 50)
if (frame) { if (frame) {
updatePlayer(config.video, frame, config['in'], config['out'], src, config) updatePlayer(config.video, frame, config['in'], config['out'], src, config)
} }