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
parent ed150f21f5
commit 89a3a119da
4 changed files with 33 additions and 27 deletions

View file

@ -21,6 +21,7 @@ Ox.ArrayEditable = function(options, self) {
separator: ',',
sort: [],
submitOnBlur: true,
tooltip: '',
type: 'input',
width: 256
})
@ -117,8 +118,14 @@ Ox.ArrayEditable = function(options, self) {
highlight: self.options.highlight,
maxHeight: self.options.maxHeight,
submitOnBlur: self.options.submitOnBlur,
tooltip: 'Click to select' + (
item.editable ? ', doubleclick to edit' : ''
tooltip: (
self.options.tooltipText
? Ox.formatString(self.options.tooltipText, item) + '<br>'
: ''
) + 'Click to select' + (
item.editable
? ', doubleclick to edit'
: ''
),
type: self.options.type,
value: item.value,

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;
});
}

View file

@ -261,7 +261,6 @@ Ox.AnnotationPanel = function(options, self) {
}
function scrollToSelected(type) {
//try {
var $item = that.find('.OxEditableElement.OxSelected'),
itemHeight = $item.height() + (type == 'text' ? 8 : 0),
itemTop = $item.offset().top,
@ -279,9 +278,6 @@ Ox.AnnotationPanel = function(options, self) {
scrollTop: scrollTop + 'px'
}, 0);
}
//} catch(e) {
// Ox.print('THIS SHOULD NOT HAPPEN');
//}
}
function selectAnnotation(data, index) {

View file

@ -181,9 +181,8 @@ Ox.VideoEditor = function(options, self) {
}
});
Ox.loop(1, self.options.layers.length + 1, function(i) {
that.bindEvent('key_' + i, function() {
var layer = self.options.layers[i - 1];
self.options.layers.forEach(function(layer, i) {
that.bindEvent('key_' + (i + 1), function() {
layer.editable
? addAnnotation(layer.id)
: that.triggerEvent('info', {layer: layer.id});