forked from 0x2620/oxjs
update video editor / annotation panel
This commit is contained in:
parent
969daf07e5
commit
815ae5d253
4 changed files with 35 additions and 25 deletions
|
|
@ -75,8 +75,12 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
edit: function() {
|
||||
$item.removeClass('OxTarget');
|
||||
},
|
||||
submit: function(data) {
|
||||
$item.addClass('OxTarget')
|
||||
submit: function(newData) {
|
||||
$item.addClass('OxTarget');
|
||||
updateAnnotation({
|
||||
id: data.id,
|
||||
value: newData.value
|
||||
});
|
||||
}
|
||||
})
|
||||
)
|
||||
|
|
@ -102,8 +106,8 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
self.$annotations.editItem(pos);
|
||||
}
|
||||
},
|
||||
remove: function(data) {
|
||||
that.triggerEvent('remove', data);
|
||||
'delete': function(data) {
|
||||
that.triggerEvent('remove', {id: data.ids[0]});
|
||||
},
|
||||
select: selectAnnotation,
|
||||
submit: updateAnnotation
|
||||
|
|
@ -149,6 +153,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
}
|
||||
|
||||
function updateAnnotation(data) {
|
||||
Ox.print('updateAnnotation', data);
|
||||
var item = Ox.getObjectById(self.options.items, data.id);
|
||||
item.value = data.value;
|
||||
that.triggerEvent('submit', item);
|
||||
|
|
@ -188,13 +193,6 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
self.$annotations.editItem(pos);
|
||||
};
|
||||
|
||||
/*@
|
||||
removeItems <f> removeItems
|
||||
@*/
|
||||
that.removeItems = function(ids) {
|
||||
self.$annotations.removeItems(ids);
|
||||
};
|
||||
|
||||
/*@
|
||||
deselectItems <f> deselectItems
|
||||
@*/
|
||||
|
|
@ -202,6 +200,13 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
self.$annotations.options('selected', []);
|
||||
};
|
||||
|
||||
/*@
|
||||
removeItems <f> removeItems
|
||||
@*/
|
||||
that.removeItem = function(id) {
|
||||
self.$annotations.removeItems([id]);
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue