main menu: add show/hide document entry

This commit is contained in:
rolux 2014-01-06 18:04:49 +05:30
parent 6b63239cf7
commit efe15c3e3b

View file

@ -135,6 +135,11 @@ pandora.ui.mainMenu = function() {
title: Ox._((ui.showBrowser ? 'Hide': 'Show') + ' {0} Browser', [Ox._(pandora.site.itemName.singular)]), title: Ox._((ui.showBrowser ? 'Hide': 'Show') + ' {0} Browser', [Ox._(pandora.site.itemName.singular)]),
disabled: !ui.item, keyboard: 'shift b' disabled: !ui.item, keyboard: 'shift b'
}, },
{
id: 'showdocument',
title: Ox._((ui.showTimeline ? 'Hide' : 'Show') + ' Document'),
disabled: !hasDocument(), keyboard: 'shift d'
},
{ {
id: 'showtimeline', id: 'showtimeline',
title: Ox._((ui.showTimeline ? 'Hide' : 'Show') + ' Timeline'), title: Ox._((ui.showTimeline ? 'Hide' : 'Show') + ' Timeline'),
@ -438,6 +443,8 @@ pandora.ui.mainMenu = function() {
pandora.UI.set({showFilters: !ui.showFilters}); pandora.UI.set({showFilters: !ui.showFilters});
} else if (data.id == 'showbrowser') { } else if (data.id == 'showbrowser') {
pandora.UI.set({showBrowser: !ui.showBrowser}); pandora.UI.set({showBrowser: !ui.showBrowser});
} else if (data.id == 'showdocument') {
pandora.UI.set({showDocument: !ui.showDocument});
} 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 == 'showannotations') { } else if (data.id == 'showannotations') {
@ -596,12 +603,15 @@ pandora.ui.mainMenu = function() {
key_shift_b: function() { key_shift_b: function() {
ui.item && pandora.UI.set({showBrowser: !ui.showBrowser}); ui.item && pandora.UI.set({showBrowser: !ui.showBrowser});
}, },
key_shift_c: function() {
hasClips && pandora.UI.set({showClips: !ui.showClips});
},
key_shift_backtick: function() { key_shift_backtick: function() {
changeFocus(-1); changeFocus(-1);
}, },
key_shift_c: function() {
hasClips() && pandora.UI.set({showClips: !ui.showClips});
},
key_shift_d: function() {
hasDocument() && pandora.UI.set({showDocument: !ui.showDocument});
}
key_shift_f: function() { key_shift_f: function() {
!ui.item && pandora.UI.set({showFilters: !ui.showFilters}); !ui.item && pandora.UI.set({showFilters: !ui.showFilters});
}, },
@ -742,6 +752,9 @@ pandora.ui.mainMenu = function() {
pandora_showclips: function(data) { pandora_showclips: function(data) {
that.setItemTitle('showclips', Ox._((data.value ? 'Hide' : 'Show') + ' Clips')); that.setItemTitle('showclips', Ox._((data.value ? 'Hide' : 'Show') + ' Clips'));
}, },
pandora_showdocument: function(data) {
that.setItemTitle('showdocument', Ox._((data.value ? 'Hide' : 'Show') + ' Document'));
}
pandora_showfilters: function(data) { pandora_showfilters: function(data) {
that.setItemTitle('showfilters', Ox._((data.value ? 'Hide' : 'Show') + ' Filters')); that.setItemTitle('showfilters', Ox._((data.value ? 'Hide' : 'Show') + ' Filters'));
}, },
@ -1042,6 +1055,10 @@ pandora.ui.mainMenu = function() {
return ui.section == 'edits' && ui.edit; return ui.section == 'edits' && ui.edit;
} }
function hasDocument() {
return ui.section == 'items' && ui.item && ui.itemView == 'documents';
}
function hasTimeline() { function hasTimeline() {
return ( return (
ui.section == 'items' && ui.item && ui.itemView == 'player' ui.section == 'items' && ui.item && ui.itemView == 'player'