From d9d79b1813adb9d6f5934ae0c75097527f3f1458 Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 10 Jun 2012 19:19:37 +0000 Subject: [PATCH] fix #781: in timelines list view, set video points immediately after position event fired by timeline, and change video preview to always display the current position --- static/js/pandora/info.js | 6 ++++++ static/js/pandora/list.js | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/static/js/pandora/info.js b/static/js/pandora/info.js index 90132738d..2af4dee0d 100644 --- a/static/js/pandora/info.js +++ b/static/js/pandora/info.js @@ -81,6 +81,9 @@ pandora.ui.info = function() { frameRatio: result.data.videoRatio, height: pandora.getInfoHeight(true), id: id, + position: !ui.item && ui.listView == 'timelines' + ? (ui.videoPoints[id] ? ui.videoPoints[id].position : 0) + : void 0, width: ui.sidebarSize }) .bindEvent({ @@ -286,6 +289,7 @@ pandora.ui.listInfo = function() { borderRadius: Math.round(size / 4) + 'px' }; } + that.resizeInfo = function() { var width = that.width(); $icon.css(getIconCSS()); @@ -297,7 +301,9 @@ pandora.ui.listInfo = function() { width: width }); }; + return that; + }; pandora.ui.posterInfo = function(data) { diff --git a/static/js/pandora/list.js b/static/js/pandora/list.js index e896db22e..52c8bfa5e 100644 --- a/static/js/pandora/list.js +++ b/static/js/pandora/list.js @@ -292,16 +292,16 @@ pandora.ui.list = function() { element: Ox.BlockVideoTimeline, events: { position: function(event) { - // FIXME: we need a way to set the position - // once the video preview has loaded - pandora.$ui.videoPreview && pandora.$ui.videoPreview.options({ - position: event.position - }); if (pandora.user.ui.videoPoints[data.id]) { pandora.UI.set('videoPoints.' + data.id + '.position', event.position); } else { pandora.UI.set('videoPoints.' + data.id, {'in': 0, out: 0, position: event.position}); } + // FIXME: we need a way to set the position + // once the video preview has loaded + pandora.$ui.videoPreview && pandora.$ui.videoPreview.options({ + position: event.position + }); } }, id: data.id,