forked from 0x2620/oxjs
edit annotations
This commit is contained in:
parent
e7b947c1ca
commit
218eeaf47a
4 changed files with 24 additions and 11 deletions
|
|
@ -68,8 +68,9 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
unique: 'id'
|
||||
})
|
||||
.bindEvent({
|
||||
cancel: function() {
|
||||
|
||||
cancel: function(item) {
|
||||
//reset in/out points
|
||||
selectAnnotation({}, {ids: [item.id]});
|
||||
},
|
||||
open: function(event, data) {
|
||||
if (data.ids.length == 1) {
|
||||
|
|
@ -77,7 +78,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
self.$annotations.editItem(pos);
|
||||
}
|
||||
},
|
||||
'remove': function(event, data) {
|
||||
remove: function(event, data) {
|
||||
that.triggerEvent('remove', data);
|
||||
},
|
||||
select: selectAnnotation,
|
||||
|
|
@ -101,7 +102,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
*/
|
||||
function selectAnnotation(event, data) {
|
||||
var item = Ox.getObjectById(self.options.items, data.ids[0]);
|
||||
that.triggerEvent('select', {
|
||||
item && that.triggerEvent('select', {
|
||||
'in': item['in'],
|
||||
'out': item.out,
|
||||
'layer': self.options.id
|
||||
|
|
@ -125,14 +126,14 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
self.options.items.splice(pos, 0, item);
|
||||
self.$annotations.addItems(pos, [item]);
|
||||
self.$annotations.editItem(pos);
|
||||
}
|
||||
};
|
||||
|
||||
/*@
|
||||
removeItems <f> removeItems
|
||||
@*/
|
||||
that.removeItems = function(ids) {
|
||||
self.$annotations.removeItems(ids);
|
||||
}
|
||||
};
|
||||
|
||||
/*@
|
||||
deselectItems <f> deselectItems
|
||||
|
|
|
|||
|
|
@ -268,8 +268,11 @@ Ox.VideoEditor = function(options, self) {
|
|||
data.out = self.options.out;
|
||||
that.triggerEvent('addAnnotation', data);
|
||||
},
|
||||
'delete': function(event, data) {
|
||||
data.layer = layer.id;
|
||||
remove: function(event, data) {
|
||||
data = {
|
||||
ids: [data],
|
||||
layer: layer.id
|
||||
};
|
||||
that.triggerEvent('removeAnnotations', data);
|
||||
},
|
||||
select: function(event, data) {
|
||||
|
|
@ -872,8 +875,8 @@ Ox.VideoEditor = function(options, self) {
|
|||
setPoint('out', data.out);
|
||||
}
|
||||
function updateAnnotation(event, data) {
|
||||
data['in'] = self.options.points[0];
|
||||
data.out = self.options.points[1];
|
||||
data['in'] = self.options['in'];
|
||||
data.out = self.options.out;
|
||||
that.triggerEvent('updateAnnotation', data);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue