extend subtitles for edits too

This commit is contained in:
j 2023-12-09 13:20:59 +00:00
parent 030f7087f4
commit 092f3c1cd1
2 changed files with 15 additions and 2 deletions

View file

@ -197,6 +197,15 @@ async function loadEdit(id, args) {
})
})
})
if (data.layers[pandora.subtitleLayer]) {
var previous;
data.layers[pandora.subtitleLayer].forEach(annotation => {
if (previous) {
previous.out = annotation['in']
}
previous = annotation
})
}
var value = []
pandora.layerKeys.forEach(layer => {
if (!data.layers[layer]) {
@ -215,7 +224,11 @@ async function loadEdit(id, args) {
</div>
`)
})
value.push('<div class="layer">' + html.join('\n') + '</div>')
var layerClass = ""
if (layerData.isSubtitles) {
layerClass = " is-subtitles"
}
value.push('<div class="layer'+layerClass+'">' + html.join('\n') + '</div>')
})
data.value = value.join('\n')

View file

@ -112,7 +112,6 @@ async function loadData(id, args) {
duration: duration
})
})
var value = []
if (data.layers[pandora.subtitleLayer]) {
var previous;
data.layers[pandora.subtitleLayer].forEach(annotation => {
@ -122,6 +121,7 @@ async function loadData(id, args) {
previous = annotation
})
}
var value = []
Object.keys(data.layers).forEach(layer => {
var html = []
var layerData = getObjectById(pandora.site.layers, layer)