support multiple layers
This commit is contained in:
parent
c562f87059
commit
e6d882c575
1 changed files with 14 additions and 3 deletions
|
@ -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 => {
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue