in timeline player, only show vertical scrollbar if needed - should fix #759, but can't be tested locally
This commit is contained in:
parent
821e8d1a4e
commit
01b4840fd6
1 changed files with 13 additions and 4 deletions
|
@ -39,7 +39,7 @@ Ox.VideoTimelinePlayer = function(options, self) {
|
||||||
self.tileWidth = 1500;
|
self.tileWidth = 1500;
|
||||||
self.tileHeight = 64;
|
self.tileHeight = 64;
|
||||||
self.margin = 8;
|
self.margin = 8;
|
||||||
self.contentWidth = self.options.width - 2 * self.margin - Ox.UI.SCROLLBAR_SIZE;
|
self.contentWidth = self.options.width - 2 * self.margin;
|
||||||
self.contentHeight = self.options.height - 32;
|
self.contentHeight = self.options.height - 32;
|
||||||
self.positionWidth = 48
|
self.positionWidth = 48
|
||||||
+ !!self.options.showMilliseconds * 2
|
+ !!self.options.showMilliseconds * 2
|
||||||
|
@ -96,7 +96,7 @@ Ox.VideoTimelinePlayer = function(options, self) {
|
||||||
.appendTo(self.$menubar);
|
.appendTo(self.$menubar);
|
||||||
|
|
||||||
self.$timelinePlayer = Ox.Element()
|
self.$timelinePlayer = Ox.Element()
|
||||||
.css({overflowX: 'hidden', overflowY: 'scroll'})
|
.css({overflowX: 'hidden', overflowY: 'auto'})
|
||||||
.bind({
|
.bind({
|
||||||
mousedown: mousedown,
|
mousedown: mousedown,
|
||||||
mouseleave: mouseleave,
|
mouseleave: mouseleave,
|
||||||
|
@ -376,8 +376,17 @@ Ox.VideoTimelinePlayer = function(options, self) {
|
||||||
return Ox.formatDuration(position, self.options.showMilliseconds);
|
return Ox.formatDuration(position, self.options.showMilliseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLines() {
|
function getLines(scrollbarIsVisible) {
|
||||||
return Math.ceil((self.frames - 1 + self.videoWidth) / self.contentWidth)
|
var lines;
|
||||||
|
if (scrollbarIsVisible) {
|
||||||
|
self.contentWidth -= Ox.UI.SCROLLBAR_SIZE;
|
||||||
|
}
|
||||||
|
lines = Math.ceil(
|
||||||
|
(self.frames - 1 + self.videoWidth) / self.contentWidth
|
||||||
|
);
|
||||||
|
return !scrollbarIsVisible && lines * (
|
||||||
|
self.tileHeight + self.margin
|
||||||
|
) + self.margin > self.options.height ? getLines(true) : lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPosition(e) {
|
function getPosition(e) {
|
||||||
|
|
Loading…
Reference in a new issue