This commit is contained in:
j 2012-02-01 18:04:42 +00:00
parent 56300ab2db
commit 2d0607aebd

View file

@ -169,7 +169,7 @@ Ox.AnnotationFolder = function(options, self) {
.bindEvent({
// FIXME: should be select, not selectplace
selectplace: function(data) {
if (!data.id && self.options.selected && Ox.getObjectById(self.options.items, self.options.selected).place.defined) {
if (!data.id && self.options.selected && Ox.getObjectById(self.options.items, self.options.selected).place) {
// only deselect annotation if the place deselect was not
// caused by switching to an annotation without place
self.$annotations.options({selected: ''});
@ -268,7 +268,7 @@ Ox.AnnotationFolder = function(options, self) {
positionA = sort[0],
positionB = sort[1];
return self.points.some(function(point) {
return point > positionA && point < positionB;
return point >= positionA && point <= positionB;
});
}
@ -309,8 +309,8 @@ Ox.AnnotationFolder = function(options, self) {
(
self.options.range == 'all' || (
self.options.range == 'selection'
&& item['in'] < self.options.out
&& item.out > self.options['in']
&& item['in'] <= self.options.out
&& item.out >= self.options['in']
) || (
self.options.range == 'position'
&& item['in'] <= self.options.position
@ -324,14 +324,6 @@ Ox.AnnotationFolder = function(options, self) {
});
}
function getPoints() {
return Ox.unique(Ox.flatten(
self.options.items.map(function(item) {
return [item['in'], item.out];
})
));
}
function getEvents() {
var events = [];
self.annotations.filter(function(item) {
@ -366,6 +358,14 @@ Ox.AnnotationFolder = function(options, self) {
return places;
}
function getPoints() {
return Ox.unique(Ox.flatten(
self.options.items.map(function(item) {
return [item['in'], item.out];
})
));
}
function getSort() {
return ({
duration: ['-duration', '+in', '+value'],