honor layer showInfo flag and display creator as part of tooltip (fixes #332)

This commit is contained in:
rlx 2012-02-05 11:08:56 +00:00
commit 89a3a119da
4 changed files with 33 additions and 27 deletions

View file

@ -34,6 +34,7 @@ Ox.AnnotationFolder = function(options, self) {
position: 0,
range: 'all',
selected: '',
showInfo: false,
showWidget: false,
sort: 'position',
title: '',
@ -225,6 +226,7 @@ Ox.AnnotationFolder = function(options, self) {
separator: ';',
sort: self.sort,
submitOnBlur: false,
tooltipText: self.options.showInfo ? '<b>{user}</b>, {modified}' : '',
width: self.options.width,
maxHeight: self.options.type == 'text' ? Infinity : void 0,
type: self.options.type == 'text' ? 'textarea' : 'input'
@ -327,7 +329,7 @@ Ox.AnnotationFolder = function(options, self) {
}
function getAnnotations() {
return self.options.items.filter(function(item) {
return Ox.map(self.options.items, function(item) {
return self.editing && item.id == self.options.selected || (
(
self.options.range == 'all' || (
@ -343,7 +345,9 @@ Ox.AnnotationFolder = function(options, self) {
self.options.users == 'all'
|| self.options.users.indexOf(item.user) > -1
)
);
) ? Ox.extend({
date: Ox.formatDate(item.modified.substr(0, 10), '%B %e, %Y')
}, item) : null;
});
}