From 356d850f34d2c39cbfd3fb856d29cdf17e29c272 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 18 Jan 2011 18:52:45 +0000 Subject: [PATCH] improvements to editor (make video size sticky, make up/down work correctly if scrollbar is visible) --- pandora/templates/site.json | 3 ++- static/js/pandora.js | 25 +++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/pandora/templates/site.json b/pandora/templates/site.json index 802878527..1a1390104 100644 --- a/pandora/templates/site.json +++ b/pandora/templates/site.json @@ -186,7 +186,8 @@ "sitePage": "home", "theme": "modern", "videoPosition": {}, - "videoSize": "fit" + "videoScreen": "fit", + "videoSize": "small" }, "username": "" } diff --git a/static/js/pandora.js b/static/js/pandora.js index a9c58d203..2466c61d5 100755 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -989,13 +989,15 @@ var pandora = new Ox.App({ videoHeight: video.height, videoId: app.user.ui.item, videoWidth: video.width, - videoSize: app.user.ui.videoSize, + videoSize: app.user.ui.videoScreen, videoURL: video.url, width: app.$ui.document.width() - app.$ui.mainPanel.size(0) - 1 }).bindEvent({ change: function(event, data) { - // showAnnotations, showControls, videoSize - UI.set(data); + // showAnnotations, showControls, videoScreen + UI.set('videoSize' in data ? { + videoScreen: data.videoSize + } : data); }, enterfullscreen: enterFullscreen, exitfullscreen: exitFullscreen @@ -1035,16 +1037,19 @@ var pandora = new Ox.App({ videoHeight: video.height, videoId: app.user.ui.item, videoWidth: video.width, - videoSize: 'small', + videoSize: app.user.ui.videoSize, videoURL: video.url, width: app.$ui.document.width() - app.$ui.mainPanel.size(0) - 1 - (app.user.ui.showAnnotations * app.user.ui.annotationsSize) - 1 - }).bindEvent('resize', function(event, data) { - //Ox.print('resize editor', data) - app.$ui.editor.options({ - width: data - }); - //Ox.print('resize done') + }).bindEvent({ + resize: function(event, data) { + app.$ui.editor.options({ + width: data + }); + }, + togglesize: function(event, data) { + UI.set({videoSize: data.size}); + } })); that.replace(1, app.$ui.annotations = ui.annotations()); that.bindEvent('resize', function(event, data) {