fix a bug where pressing delete would not remove an annotation if the video editor had focus (fixes #477)

This commit is contained in:
rlx 2012-02-19 14:37:55 +00:00
parent bd5b6f8230
commit 6a9707ed0b
3 changed files with 14 additions and 16 deletions

View file

@ -614,17 +614,6 @@ Ox.AnnotationFolder = function(options, self) {
} }
}; };
/*@
removeItems <f> removeItems
@*/
/*
that.removeItem = function(id) {
var pos = Ox.getIndexById(self.options.items, id);
self.options.items.splice(pos, 1);
self.$annotations.removeItems && self.$annotations.removeItems([id]);
};
*/
that.updateItem = function(id, data) { that.updateItem = function(id, data) {
Ox.print('-- UPDATE ITEM', id, data); Ox.print('-- UPDATE ITEM', id, data);
var item = Ox.getObjectById(self.options.items, id); var item = Ox.getObjectById(self.options.items, id);

View file

@ -486,11 +486,17 @@ Ox.AnnotationPanel = function(options, self) {
renderEditMenu(); renderEditMenu();
}; };
that.removeItem = function() { that.removeItem = function(remove) {
self.options.selected = ''; if (remove) {
self.users = getUsers(); // remove initiated by video editor
renderOptionsMenu(); getFolder(self.options.selected).removeItem();
renderEditMenu(); } else {
// called from removeannotation callback
self.options.selected = '';
self.users = getUsers();
renderOptionsMenu();
renderEditMenu();
}
}; };
that.updateItem = function(id, item) { that.updateItem = function(id, item) {

View file

@ -83,6 +83,9 @@ Ox.VideoEditor = function(options, self) {
key_comma: function() { key_comma: function() {
movePositionTo('cut', -1); movePositionTo('cut', -1);
}, },
key_delete: function() {
self.$annotationPanel.removeItem(true);
},
key_dot: function() { key_dot: function() {
movePositionTo('cut', 1); movePositionTo('cut', 1);
}, },