forked from 0x2620/oxjs
fix multiple id selection in VideoAnnotationPanel chain
This commit is contained in:
parent
8e760c3959
commit
01596fa174
2 changed files with 32 additions and 26 deletions
|
|
@ -581,26 +581,40 @@ Ox.AnnotationFolder = function(options, self) {
|
||||||
|
|
||||||
function selectAnnotation(data) {
|
function selectAnnotation(data) {
|
||||||
if (self.loaded) {
|
if (self.loaded) {
|
||||||
var item = Ox.getObjectById(self.options.items, data.id);
|
var extendedData;
|
||||||
self.options.selected = item ? data.id : '';
|
if (Ox.isArray(data.id) && data.id.length) {
|
||||||
if (self.widget) {
|
var items = data.id.map(id => {
|
||||||
if (self.options.type == 'event') {
|
return Ox.getObjectById(self.options.items, id);
|
||||||
self.$calendar.options({
|
})
|
||||||
selected: item && isDefined(item) ? item.event.id : ''
|
self.options.selected = data.id;
|
||||||
})
|
extendedData = Ox.extend(data, {
|
||||||
.panToEvent();
|
'in': Ox.min(items.map(item => { return item["in"]; })),
|
||||||
} else {
|
out: Ox.max(items.map(item => { return item["out"]; })),
|
||||||
self.$map.options({
|
layer: self.options.id
|
||||||
selected: item && isDefined(item) ? item.place.id : ''
|
});
|
||||||
})
|
} else {
|
||||||
.panToPlace();
|
var item = Ox.getObjectById(self.options.items, data.id)
|
||||||
|
self.options.selected = item ? data.id : '';
|
||||||
|
if (self.widget) {
|
||||||
|
if (self.options.type == 'event') {
|
||||||
|
self.$calendar.options({
|
||||||
|
selected: item && isDefined(item) ? item.event.id : ''
|
||||||
|
})
|
||||||
|
.panToEvent();
|
||||||
|
} else {
|
||||||
|
self.$map.options({
|
||||||
|
selected: item && isDefined(item) ? item.place.id : ''
|
||||||
|
})
|
||||||
|
.panToPlace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
extendedData = Ox.extend(data, item ? {
|
||||||
|
'in': item['in'],
|
||||||
|
out: item.out,
|
||||||
|
layer: self.options.id
|
||||||
|
} : {});
|
||||||
}
|
}
|
||||||
that.triggerEvent('select', Ox.extend(data, item ? {
|
that.triggerEvent('select', extendedData)
|
||||||
'in': item['in'],
|
|
||||||
out: item.out,
|
|
||||||
layer: self.options.id
|
|
||||||
} : {}));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1357,14 +1357,6 @@ Ox.VideoAnnotationPanel = function(options, self) {
|
||||||
if (Ox.isUndefined(data)) {
|
if (Ox.isUndefined(data)) {
|
||||||
// doubleclick on small timeline
|
// doubleclick on small timeline
|
||||||
data = getAnnotation();
|
data = getAnnotation();
|
||||||
} else if (Ox.isArray(data.id)) {
|
|
||||||
var range = data.id.map(id => {
|
|
||||||
return Ox.getObjectById(self.annotations, id)
|
|
||||||
})
|
|
||||||
data['in'] = Ox.min(range.map(annotation => { return annotation["in"]; }))
|
|
||||||
data['out'] = Ox.max(range.map(annotation => { return annotation["out"]; }))
|
|
||||||
setPoint('in', data['in'], true);
|
|
||||||
setPoint('out', data.out, true);
|
|
||||||
} else if (!data.id && Ox.$elements[that.oxid]) {
|
} else if (!data.id && Ox.$elements[that.oxid]) {
|
||||||
// focus only if in the dom
|
// focus only if in the dom
|
||||||
that.gainFocus();
|
that.gainFocus();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue