honor layer showInfo flag and display creator as part of tooltip (fixes #332)
This commit is contained in:
parent
ed150f21f5
commit
89a3a119da
4 changed files with 33 additions and 27 deletions
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -261,27 +261,23 @@ 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,
|
||||
itemBottom = itemTop + itemHeight,
|
||||
height = self.$folders.height(),
|
||||
scrollTop = self.$folders.scrollTop(),
|
||||
top = self.$folders.offset().top;
|
||||
if (itemTop < top || itemBottom > top + height) {
|
||||
if (itemTop < top) {
|
||||
scrollTop += itemTop - top;
|
||||
} else {
|
||||
scrollTop += itemBottom - top - height;
|
||||
}
|
||||
self.$folders.animate({
|
||||
scrollTop: scrollTop + 'px'
|
||||
}, 0);
|
||||
var $item = that.find('.OxEditableElement.OxSelected'),
|
||||
itemHeight = $item.height() + (type == 'text' ? 8 : 0),
|
||||
itemTop = $item.offset().top,
|
||||
itemBottom = itemTop + itemHeight,
|
||||
height = self.$folders.height(),
|
||||
scrollTop = self.$folders.scrollTop(),
|
||||
top = self.$folders.offset().top;
|
||||
if (itemTop < top || itemBottom > top + height) {
|
||||
if (itemTop < top) {
|
||||
scrollTop += itemTop - top;
|
||||
} else {
|
||||
scrollTop += itemBottom - top - height;
|
||||
}
|
||||
//} catch(e) {
|
||||
// Ox.print('THIS SHOULD NOT HAPPEN');
|
||||
//}
|
||||
self.$folders.animate({
|
||||
scrollTop: scrollTop + 'px'
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function selectAnnotation(data, index) {
|
||||
|
|
|
@ -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});
|
||||
|
|
Loading…
Reference in a new issue