fix enabling/disabling of show/hide options in view menu; add 'enter fullscreen' option, fixes #709

This commit is contained in:
rolux 2012-03-23 12:00:04 +00:00
parent e38a1e92f8
commit f2c0032054

View file

@ -111,6 +111,8 @@ pandora.ui.mainMenu = function() {
{ id: 'showannotations', title: (ui.showAnnotations ? 'Hide' : 'Show') + ' Annotations', disabled: !ui.item || ['timeline', 'video'].indexOf(ui.itemView) == -1, keyboard: 'shift a' }, { id: 'showannotations', title: (ui.showAnnotations ? 'Hide' : 'Show') + ' Annotations', disabled: !ui.item || ['timeline', 'video'].indexOf(ui.itemView) == -1, keyboard: 'shift a' },
{ id: 'showtimeline', title: (ui.showTimeline ? 'Hide' : 'Show') + ' Timeline', disabled: !ui.item || ui.itemView != 'video', keyboard: 'shift t' }, { id: 'showtimeline', title: (ui.showTimeline ? 'Hide' : 'Show') + ' Timeline', disabled: !ui.item || ui.itemView != 'video', keyboard: 'shift t' },
{}, {},
{ id: 'fullscreen', title: 'Enter Fullscreen', disabled: !ui.item || ui.itemView != 'video' },
{},
{ id: 'theme', title: 'Theme', items: [ { id: 'theme', title: 'Theme', items: [
{ group: 'settheme', min: 1, max: 1, items: [ { group: 'settheme', min: 1, max: 1, items: [
{ id: 'classic', title: 'Light', checked: ui.theme == 'classic'}, { id: 'classic', title: 'Light', checked: ui.theme == 'classic'},
@ -286,6 +288,8 @@ pandora.ui.mainMenu = function() {
pandora.UI.set({showAnnotations: !ui.showAnnotations}); pandora.UI.set({showAnnotations: !ui.showAnnotations});
} else if (data.id == 'showtimeline') { } else if (data.id == 'showtimeline') {
pandora.UI.set({showTimeline: !ui.showTimeline}); pandora.UI.set({showTimeline: !ui.showTimeline});
} else if (data.id == 'fullscreen') {
pandora.$ui.player.options({fullscreen: true});
} else if (data.id == 'advancedfind') { } else if (data.id == 'advancedfind') {
if (!pandora.hasDialogOrScreen()) { if (!pandora.hasDialogOrScreen()) {
pandora.$ui.filterDialog = pandora.ui.filterDialog().open(); pandora.$ui.filterDialog = pandora.ui.filterDialog().open();
@ -426,12 +430,21 @@ pandora.ui.mainMenu = function() {
} }
if (!data.value) { if (!data.value) {
that.disableItem('showannotations'); that.disableItem('showannotations');
} else if (['video', 'timeline'].indexOf(ui.itemView) > -1) { that.disableItem('showtimeline');
that.enableItem('showannotations'); that.disableItem('fullscreen');
} else {
if (['video', 'timeline'].indexOf(ui.itemView) > -1) {
that.enableItem('showannotations');
}
if (ui.itemView == 'video') {
that.enableItem('showtimeline');
that.enableItem('fullscreen');
}
} }
}, },
pandora_itemview: function(data) { pandora_itemview: function(data) {
var isVideoView = ['video', 'timeline'].indexOf(data.value) > -1, var action,
isVideoView = ['video', 'timeline'].indexOf(data.value) > -1,
wasVideoView = ['video', 'timeline'].indexOf(data.previousValue) > -1; wasVideoView = ['video', 'timeline'].indexOf(data.previousValue) > -1;
that.checkItem('viewMenu_item_' + data.value); that.checkItem('viewMenu_item_' + data.value);
if (isVideoView) { if (isVideoView) {
@ -441,7 +454,9 @@ pandora.ui.mainMenu = function() {
that[isVideoView ? 'enableItem' : 'disableItem']('showannotations'); that[isVideoView ? 'enableItem' : 'disableItem']('showannotations');
} }
if ((data.value == 'video') != (data.previousValue == 'video')) { if ((data.value == 'video') != (data.previousValue == 'video')) {
that[data.value == 'video' ? 'enableItem' : 'disableItem']('showtimeline'); action = data.value == 'video' ? 'enableItem' : 'disableItem';
that[action]('showtimeline');
that[action]('fullscreen');
} }
}, },
pandora_listselection: function(data) { pandora_listselection: function(data) {