diff --git a/source/Ox.UI/js/Video/Ox.VideoTimelinePlayer.js b/source/Ox.UI/js/Video/Ox.VideoTimelinePlayer.js index 58634735..31a8a31d 100644 --- a/source/Ox.UI/js/Video/Ox.VideoTimelinePlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoTimelinePlayer.js @@ -39,7 +39,7 @@ Ox.VideoTimelinePlayer = function(options, self) { self.tileWidth = 1500; self.tileHeight = 64; 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.positionWidth = 48 + !!self.options.showMilliseconds * 2 @@ -96,7 +96,7 @@ Ox.VideoTimelinePlayer = function(options, self) { .appendTo(self.$menubar); self.$timelinePlayer = Ox.Element() - .css({overflowX: 'hidden', overflowY: 'scroll'}) + .css({overflowX: 'hidden', overflowY: 'auto'}) .bind({ mousedown: mousedown, mouseleave: mouseleave, @@ -376,8 +376,17 @@ Ox.VideoTimelinePlayer = function(options, self) { return Ox.formatDuration(position, self.options.showMilliseconds); } - function getLines() { - return Math.ceil((self.frames - 1 + self.videoWidth) / self.contentWidth) + function getLines(scrollbarIsVisible) { + 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) {