delay height calculation
This commit is contained in:
parent
27562973e7
commit
f39f854821
3 changed files with 36 additions and 16 deletions
|
|
@ -445,14 +445,19 @@ function renderSingleMode(config) {
|
|||
annot.style.position = 'absolute'
|
||||
text.appendChild(annot)
|
||||
})
|
||||
var height = 0
|
||||
text.querySelectorAll('.annotation.single').forEach(annotation => {
|
||||
var rect = annotation.getBoundingClientRect()
|
||||
if (rect.height > height) {
|
||||
height = rect.height
|
||||
}
|
||||
})
|
||||
text.style.height = height + 'px';
|
||||
if (config.annotations.length) {
|
||||
text.style.height = '72px';
|
||||
}
|
||||
setTimeout(() => {
|
||||
var height = 0
|
||||
text.querySelectorAll('.annotation.single').forEach(annotation => {
|
||||
var rect = annotation.getBoundingClientRect()
|
||||
if (rect.height > height) {
|
||||
height = rect.height
|
||||
}
|
||||
})
|
||||
text.style.height = height + 'px';
|
||||
}, 50)
|
||||
if (frame) {
|
||||
updatePlayer(config.video, frame, config['in'], config['out'], src, config)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue