improvements to editor (make video size sticky, make up/down work correctly if scrollbar is visible)

This commit is contained in:
rolux 2011-01-18 18:52:45 +00:00
parent a109f67db5
commit 356d850f34
2 changed files with 17 additions and 11 deletions

View file

@ -186,7 +186,8 @@
"sitePage": "home", "sitePage": "home",
"theme": "modern", "theme": "modern",
"videoPosition": {}, "videoPosition": {},
"videoSize": "fit" "videoScreen": "fit",
"videoSize": "small"
}, },
"username": "" "username": ""
} }

View file

@ -989,13 +989,15 @@ var pandora = new Ox.App({
videoHeight: video.height, videoHeight: video.height,
videoId: app.user.ui.item, videoId: app.user.ui.item,
videoWidth: video.width, videoWidth: video.width,
videoSize: app.user.ui.videoSize, videoSize: app.user.ui.videoScreen,
videoURL: video.url, videoURL: video.url,
width: app.$ui.document.width() - app.$ui.mainPanel.size(0) - 1 width: app.$ui.document.width() - app.$ui.mainPanel.size(0) - 1
}).bindEvent({ }).bindEvent({
change: function(event, data) { change: function(event, data) {
// showAnnotations, showControls, videoSize // showAnnotations, showControls, videoScreen
UI.set(data); UI.set('videoSize' in data ? {
videoScreen: data.videoSize
} : data);
}, },
enterfullscreen: enterFullscreen, enterfullscreen: enterFullscreen,
exitfullscreen: exitFullscreen exitfullscreen: exitFullscreen
@ -1035,16 +1037,19 @@ var pandora = new Ox.App({
videoHeight: video.height, videoHeight: video.height,
videoId: app.user.ui.item, videoId: app.user.ui.item,
videoWidth: video.width, videoWidth: video.width,
videoSize: 'small', videoSize: app.user.ui.videoSize,
videoURL: video.url, videoURL: video.url,
width: app.$ui.document.width() - app.$ui.mainPanel.size(0) - 1 - width: app.$ui.document.width() - app.$ui.mainPanel.size(0) - 1 -
(app.user.ui.showAnnotations * app.user.ui.annotationsSize) - 1 (app.user.ui.showAnnotations * app.user.ui.annotationsSize) - 1
}).bindEvent('resize', function(event, data) { }).bindEvent({
//Ox.print('resize editor', data) resize: function(event, data) {
app.$ui.editor.options({ app.$ui.editor.options({
width: data width: data
}); });
//Ox.print('resize done') },
togglesize: function(event, data) {
UI.set({videoSize: data.size});
}
})); }));
that.replace(1, app.$ui.annotations = ui.annotations()); that.replace(1, app.$ui.annotations = ui.annotations());
that.bindEvent('resize', function(event, data) { that.bindEvent('resize', function(event, data) {