1
0
Fork 0
forked from 0x2620/oxjs

update video editor

This commit is contained in:
rlx 2012-01-16 23:21:53 +05:30
commit 7da384d03a
5 changed files with 98 additions and 38 deletions

View file

@ -243,15 +243,33 @@ Ox.AnnotationPanel = function(options, self) {
}
function selectAnnotation(data, index) {
var height, scrollTop;
var height, scrollBottom, scrollTop, top;
if (data.id) {
self.$folder.forEach(function($folder, i) {
i != index && $folder.options({selected: ''});
});
}
if (data.top) {
data.bottom = data.top + data.height;
height = self.$folders.height();
top = self.$folders.offset().top;
Ox.print('top', top);
scrollTop = self.$folders.scrollTop();
Ox.print('data/self t/b/h', data.top, data.bottom, data.height, scrollTop, height)
if (data.top < top || data.bottom > height) {
if (data.top < top) {
Ox.print('top scrollTop', data.top, scrollTop)
scrollTop += data.top - top;
} else {
scrollTop += data.bottom - top - height;
}
self.$folders.animate({
scrollTop: scrollTop + 'px'
}, 0);
}
/*
data.top -= 60; // 20 + 24 + 16
Ox.print('HEIGHT', height, 'SCROLLTOP', scrollTop, 'TOP', data.top);
if (data.top < 0 || data.top > height - 16) {
@ -260,10 +278,8 @@ Ox.AnnotationPanel = function(options, self) {
} else if (data.top > height - 16) {
scrollTop += data.top - height + 14;
}
self.$folders.animate({
scrollTop: scrollTop + 'px'
}, 0);
}
*/
}
that.triggerEvent('select', data);
}