From 2e09efbe53682fa528ccd254cc88826fc48ac071 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 17 Apr 2012 13:43:14 +0000 Subject: [PATCH] implement 'follow player while playing' --- static/js/pandora/browser.js | 14 ++++++-------- static/js/pandora/timeline.js | 3 +++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/static/js/pandora/browser.js b/static/js/pandora/browser.js index 1c5b90148..bd0743214 100644 --- a/static/js/pandora/browser.js +++ b/static/js/pandora/browser.js @@ -107,13 +107,6 @@ pandora.ui.browser = function() { open: function() { that.scrollToSelection(); }, - resize: function(data) { - if (pandora.user.ui.itemView == 'map') { - pandora.ui.$map.resizeMap(); - } else if (pandora.user.ui.itemView == 'calendar') { - pandora.ui.$calendar.resizeCalendar(); - } - }, select: function(data) { data.ids.length && pandora.UI.set({ 'item': data.ids[0] @@ -122,11 +115,16 @@ pandora.ui.browser = function() { toggle: function(data) { pandora.UI.set({showBrowser: !data.collapsed}); if (data.collapsed) { + // fixme: can we do this for timeline and player too? if (pandora.user.ui.itemView == 'editor') { pandora.$ui.editor.gainFocus(); } } - if (pandora.user.ui.itemView == 'map') { + if (pandora.user.ui.itemView == 'timeline') { + pandora.$ui.timeline.options({ + height: pandora.$ui.contentPanel.size(1) + }); + } else if (pandora.user.ui.itemView == 'map') { pandora.$ui.map.resizeMap(); } else if (pandora.user.ui.itemView == 'calendar') { pandora.$ui.calendar.resizeCalendar(); diff --git a/static/js/pandora/timeline.js b/static/js/pandora/timeline.js index c84a29d7e..aac2e6847 100644 --- a/static/js/pandora/timeline.js +++ b/static/js/pandora/timeline.js @@ -58,6 +58,9 @@ pandora.ui.timeline = function(data) { annotationssort: function(data) { pandora.UI.set({annotationsSort: data.sort}); }, + follow: function(data) { + pandora.UI.set('followPlayer', data.follow); + }, muted: function(data) { pandora.UI.set('videoMuted', data.muted); },