1
0
Fork 0
forked from 0x2620/oxjs

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

@ -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) {