1
0
Fork 0
forked from 0x2620/oxjs

make selected annotation scroll into view

This commit is contained in:
rlx 2012-01-11 15:02:33 +05:30
commit 923f71e6de
4 changed files with 30 additions and 11 deletions

View file

@ -396,10 +396,8 @@ Ox.VideoEditor = function(options, self) {
self.$annotationPanel[i_].options({selected: ''});
}
});
selectAnnotation(data);
} else {
// ...
}
selectAnnotation(data);
},
submit: submitAnnotation,
toggle: function(data) {
@ -1100,11 +1098,26 @@ Ox.VideoEditor = function(options, self) {
if (self.options.selected) {
setPoint('in', data['in']);
setPoint('out', data.out);
Ox.print('???', JSON.stringify(self.options.selected), getPanel(self.options.selected))
getPanel(self.options.selected).options({selected: self.options.selected});
}
setTimelineState();
updateEditMenu();
if (data.top) {
var height = self.$annotations.height(),
scrollTop = self.$annotations.scrollTop();
data.top -= 60; // 20 + 24 + 16
Ox.print('HEIGHT', height, 'SCROLLTOP', scrollTop, 'TOP', data.top);
if (data.top < 0 || data.top > height - 16) {
if (data.top < 0) {
scrollTop += data.top - 3;
} else if (data.top > height - 16) {
scrollTop += data.top - height + 14;
}
self.$annotations.animate({
scrollTop: scrollTop + 'px'
}, 0);
}
}
that.triggerEvent('select', {
id: self.options.selected
});