forked from 0x2620/oxjs
make cursor keys work across annotation folders; make clicking in string annotation folder deselect annotation in other folder
This commit is contained in:
parent
2d0607aebd
commit
1eaf240970
3 changed files with 73 additions and 8 deletions
|
|
@ -237,6 +237,15 @@ Ox.AnnotationFolder = function(options, self) {
|
|||
that.triggerEvent('edit');
|
||||
},
|
||||
select: selectAnnotation,
|
||||
selectafter: function() {
|
||||
that.triggerEvent('selectafter');
|
||||
},
|
||||
selectbefore: function() {
|
||||
that.triggerEvent('selectbefore');
|
||||
},
|
||||
selectnone: function() {
|
||||
that.triggerEvent('selectnone');
|
||||
},
|
||||
submit: submitAnnotation,
|
||||
key_space: function() {
|
||||
that.triggerEvent('paused');
|
||||
|
|
@ -560,6 +569,20 @@ Ox.AnnotationFolder = function(options, self) {
|
|||
return that;
|
||||
};
|
||||
|
||||
that.selectItem = function(position) {
|
||||
// selects the first (0) or last (-1) visible annotation
|
||||
if (self.annotations.length) {
|
||||
that.options({selected: self.annotations[
|
||||
position == 0 ? 0 : self.annotations.length - 1
|
||||
].id});
|
||||
self.$annotations.gainFocus();
|
||||
} else {
|
||||
that.triggerEvent(
|
||||
position == 0 ? 'selectafter' : 'selectbefore'
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/*@
|
||||
removeItems <f> removeItems
|
||||
@*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue