make space work when annotation panel has focus; give focus to video editor when deselecting annotation in panel

This commit is contained in:
rlx 2012-01-11 17:34:49 +05:30
parent ef82ff8967
commit e98696b93d
2 changed files with 10 additions and 5 deletions

View file

@ -96,7 +96,10 @@ Ox.AnnotationPanel = function(options, self) {
that.triggerEvent('edit');
},
select: selectAnnotation,
submit: submitAnnotation
submit: submitAnnotation,
key_space: function() {
that.triggerEvent('paused');
}
});
}
self.$annotations.appendTo(that.$content);

View file

@ -383,6 +383,7 @@ Ox.VideoEditor = function(options, self) {
self.editing = true;
setTimelineState();
},
paused: togglePaused,
remove: function(data) {
that.triggerEvent('removeannotation', {
id: data.id,
@ -396,6 +397,8 @@ Ox.VideoEditor = function(options, self) {
self.$annotationPanel[i_].options({selected: ''});
}
});
} else {
that.gainFocus();
}
selectAnnotation(data);
},
@ -738,8 +741,9 @@ Ox.VideoEditor = function(options, self) {
self.$editMenuButton = Ox.MenuButton({
items: [
{id: 'edit', title: 'Edit Selected Annotation', disabled: !self.options.selected, keyboard: 'return'},
{id: 'delete', title: 'Delete Selected Annotation', disabled: !self.options.selected, keyboard: 'delete'},
{id: 'edit', title: 'Edit Annotation', disabled: !self.options.selected, keyboard: 'return'},
{id: 'delete', title: 'Delete Annotation', disabled: !self.options.selected, keyboard: 'delete'},
{id: 'deselect', title: 'Deselect Annotation', disabled: !self.options.selected, keyboard: 'escape'},
{},
{id: 'save', title: 'Save Changes', disabled: true, keyboard: 'shift return'},
{id: 'undo', title: 'Undo Changes', disabled: true, keyboard: 'escape'}
@ -1290,11 +1294,9 @@ Ox.VideoEditor = function(options, self) {
function togglePaused() {
self.$player[0].togglePaused();
///* FIXME
self.$player[0].options('paused') && that.triggerEvent('position', {
position: self.$player[0].options('position')
});
//*/
}
function toggleSize() {