1
0
Fork 0
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:
rlx 2012-02-01 19:33:10 +00:00
commit 1eaf240970
3 changed files with 73 additions and 8 deletions

View file

@ -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
@*/