allow for retrieving currently shown annotations from video annotation panel

This commit is contained in:
rlx 2014-09-18 16:43:00 +02:00
parent ceca50ae59
commit f1120a825b
3 changed files with 23 additions and 2 deletions

View file

@ -106,7 +106,9 @@ Ox.AnnotationFolder = function(options, self) {
self.$widget.options({width: self.options.width});
}
self.$annotations.options({
width: self.options.type == 'text' ? self.options.width + 8 : self.options.width
width: self.options.type == 'text'
? self.options.width + 8
: self.options.width
});
}
});
@ -646,6 +648,10 @@ Ox.AnnotationFolder = function(options, self) {
return that;
};
that.getCurrentAnnotations = function() {
return getAnnotations();
};
/*@
removeItem <f> remove item
() -> <o> remove selected item

View file

@ -493,7 +493,8 @@ Ox.AnnotationPanel = function(options, self) {
$folder.options({users: self.enabledUsers});
});
} else {
set[data.id] = data.checked[0].id;
self.options[data.id] = data.checked[0].id;
set[data.id] = self.options[data.id];
self.$folder.forEach(function($folder) {
$folder.options(set);
});
@ -646,6 +647,16 @@ Ox.AnnotationPanel = function(options, self) {
return that;
};
that.getCurrentAnnotations = function() {
var annotations = {};
self.options.layers.forEach(function(layer) {
annotations[layer.id] = self.$folder[
Ox.getIndexById(self.options.layers, layer.id)
].getCurrentAnnotations();
});
return annotations;
};
/*@
removeItem <f> Remove selected item
() -> <o> AnnotationPanel

View file

@ -1632,6 +1632,10 @@ Ox.VideoAnnotationPanel = function(options, self) {
self.$annotationPanel.addItem(layer, annotation);
};
that.getCurrentAnnotations = function() {
return self.$annotationPanel.getCurrentAnnotations();
};
/*@
updateAnnotation <f> updateAnnotation
(id, annotation) -> <o> update annotation with id