forked from 0x2620/oxjs
pass video editor keyboard events when annotations have focus (fixes #318)
This commit is contained in:
parent
c040e48601
commit
6f3a4d1386
3 changed files with 36 additions and 76 deletions
|
|
@ -260,37 +260,24 @@ Ox.AnnotationFolder = function(options, self) {
|
|||
selectnone: function() {
|
||||
that.triggerEvent('selectnone');
|
||||
},
|
||||
submit: submitAnnotation,
|
||||
key_b: function() {
|
||||
that.triggerEvent('key_b');
|
||||
},
|
||||
key_equal: function() {
|
||||
that.triggerEvent('key_equal');
|
||||
},
|
||||
key_f: function() {
|
||||
that.triggerEvent('key_f');
|
||||
},
|
||||
key_g: function() {
|
||||
that.triggerEvent('key_g');
|
||||
},
|
||||
key_minus: function() {
|
||||
that.triggerEvent('key_minus');
|
||||
},
|
||||
key_n: function() {
|
||||
that.triggerEvent('key_n');
|
||||
},
|
||||
key_shift_g: function() {
|
||||
that.triggerEvent('key_shift_g');
|
||||
},
|
||||
key_space: function() {
|
||||
that.triggerEvent('key_space');
|
||||
}
|
||||
submit: submitAnnotation
|
||||
})
|
||||
.appendTo(
|
||||
['event', 'place'].indexOf(self.options.type) > -1
|
||||
? self.$outer : that.$content
|
||||
);
|
||||
|
||||
[
|
||||
'0', 'b', 'backslash', 'closebracket', 'comma', 'dot', 'equal',
|
||||
'f', 'g', 'h', 'i', 'minus', 'n', 'o', 'openbracket', 'p',
|
||||
'shift_0', 'shift_g', 'shift_i', 'shift_o', 'slash', 'space'
|
||||
].forEach(function(key) {
|
||||
key = 'key_' + key;
|
||||
self.$annotations.bindEvent(key, function() {
|
||||
that.triggerEvent(key);
|
||||
});
|
||||
});
|
||||
|
||||
self.options.selected && setTimeout(function() {
|
||||
// need timeout in order to trigger events
|
||||
if (self.options.collapsed) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue