update annotation folder

This commit is contained in:
rolux 2013-03-08 16:48:20 +05:30
parent 317b433a5c
commit e7e20ecc3c

View file

@ -78,6 +78,7 @@ Ox.AnnotationFolder = function(options, self) {
}
} else if (key == 'range') {
updateAnnotations();
self.$annotation.options({placeholder: getPlaceholder()});
} else if (key == 'selected') {
if (value === '') {
self.editing = false;
@ -267,11 +268,7 @@ Ox.AnnotationFolder = function(options, self) {
: null,
highlight: self.options.highlight,
items: self.annotations,
placeholder: 'No ' + self.options.title.toLowerCase() + (
self.options.range == 'position' ? ' at current position'
: self.options.range == 'selection' ? ' in current selection'
: ''
),
placeholder: getPlaceholder(),
selected: self.options.selected,
separator: ';',
sort: self.sort,
@ -432,6 +429,14 @@ Ox.AnnotationFolder = function(options, self) {
return events;
}
function getPlaceholder() {
return 'No ' + self.options.title.toLowerCase() + (
self.options.range == 'position' ? ' at current position'
: self.options.range == 'selection' ? ' in current selection'
: ''
);
}
function getPlaces() {
var places = [];
self.annotations.filter(function(item) {