add 'add annotation' entries to annotation panel menu

This commit is contained in:
rolux 2014-01-17 14:53:34 +00:00
parent 819f803c02
commit e4b0b306b2
2 changed files with 7 additions and 3 deletions

View file

@ -599,8 +599,6 @@ Ox.AnnotationFolder = function(options, self) {
.editItem();
showWarnings();
self.points = getPoints();
//selectAnnotation(item);
//that.triggerEvent('edit');
return that;
};

View file

@ -7,7 +7,7 @@ Ox.AnnotationPanel <f> Video Annotation Panel
options <o> Options object
calendarSize <n|256> calendar size
clickLink <f|null> click link callback
editable: <b|false> if true, annotations can be edited
editable <b|false> if true, annotations can be edited
font <s|'small'> small, medium, large
highlight <s|''> highlight given string in annotations
layers <a|[]> array with annotation objects
@ -397,6 +397,9 @@ Ox.AnnotationPanel = function(options, self) {
self.$optionsMenuButton && self.$optionsMenuButton.remove();
self.$optionsMenuButton = Ox.MenuButton({
items: [].concat(
self.options.editable ? self.options.layers.map(function(layer) {
return {id: layer.id, title: Ox._('Add {0}', [layer.item])}
}).concat({}) : [],
[
{id: 'showannotations', title: Ox._('Show Annotations'), disabled: true},
{group: 'range', min: 1, max: 1, items: [
@ -455,6 +458,9 @@ Ox.AnnotationPanel = function(options, self) {
that.triggerEvent('annotations' + data.id, set);
}
},
click: function(data) {
that.triggerEvent('add', {layer: data.id, value: ''});
},
hide: function() {
self.options.selected
? getFolder(self.options.selected).gainFocus()