support multiple layers

This commit is contained in:
j 2021-11-24 11:47:47 +01:00
parent c562f87059
commit e6d882c575

View file

@ -304,9 +304,20 @@ function loadAnnotations(config) {
pandoraAPI('get', {id: config.item, keys: [
'layers'
]}).then(response => {
var annotations = response.data.layers[config.layer].filter(annotation => {
return !(config.user && annotation.user != config.user)
})
var annotations = []
if (Array.isArray(config.layer) {
config.layer.forEach(layer => {
response.data.layers[layer].forEach(annotation => {
if (!(config.user && annotation.user != config.user)) {
annotations.push(annotation)
}
})
})
} else {
annotations = response.data.layers[config.layer].filter(annotation => {
return !(config.user && annotation.user != config.user)
})
}
loadClips(annotations).then(annotations => {
config.annotations = annotations.filter(annotation => {
if (config.only_e) {