allow selecting multiple annotations to get in/out range
This commit is contained in:
parent
dd8ea22d45
commit
10c78fc862
1 changed files with 27 additions and 1 deletions
|
@ -391,7 +391,21 @@ pandora.ui.editor = function(data) {
|
|||
pandora.UI.set({videoResolution: data.resolution});
|
||||
},
|
||||
select: function(data) {
|
||||
pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1] || '');
|
||||
if (Ox.isArray(data.id)) {
|
||||
var range = data.id.map(id => {
|
||||
return getAnnotationById(id)
|
||||
})
|
||||
data['in'] = Ox.min(range.map(annotation => { return annotation["in"]; }))
|
||||
data['out'] = Ox.max(range.map(annotation => { return annotation["out"]; }))
|
||||
pandora.UI.set('videoPoints.' + ui.item, {
|
||||
annotation: '',
|
||||
'in': data['in'],
|
||||
out: data.out,
|
||||
position: ui.videoPoints[ui.item].position
|
||||
})
|
||||
} else {
|
||||
pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1] || '');
|
||||
}
|
||||
},
|
||||
showentityinfo: function(data) {
|
||||
pandora.URL.push('/entities/' + data.id)
|
||||
|
@ -428,6 +442,18 @@ pandora.ui.editor = function(data) {
|
|||
|
||||
pandora._dontSelectResult = false;
|
||||
|
||||
function getAnnotationById(id) {
|
||||
var annotation
|
||||
data.annotations.forEach(layer => {
|
||||
layer.items.forEach(a => {
|
||||
if (a.id == id) {
|
||||
annotation = a
|
||||
}
|
||||
})
|
||||
})
|
||||
return annotation;
|
||||
}
|
||||
|
||||
function updateBrowser() {
|
||||
pandora.$ui.browser.find('img[src*="/' + ui.item + '/"]').each(function() {
|
||||
$(this).attr({
|
||||
|
|
Loading…
Reference in a new issue