fix bugs with enabling/disabling the showannotations entry in the view menu

This commit is contained in:
rolux 2011-10-13 10:19:56 +00:00
parent 883e9d58e6
commit 545fa1acfc

View file

@ -265,10 +265,15 @@ pandora.ui.mainMenu = function() {
that[data.value ? 'disableItem' : 'enableItem']('showgroups'); that[data.value ? 'disableItem' : 'enableItem']('showgroups');
that[data.value ? 'enableItem' : 'disableItem']('showbrowser'); that[data.value ? 'enableItem' : 'disableItem']('showbrowser');
} }
if (!data.value) {
that.disableItem('showannotations');
} else if (['video', 'timeline'].indexOf(ui.itemView) > -1) {
that.enableItem('showannotations');
}
}, },
pandora_itemview: function(data) { pandora_itemview: function(data) {
var isVideoView = ['video', 'timeline'].indexOf(data.value) > 1, var isVideoView = ['video', 'timeline'].indexOf(data.value) > -1,
wasVideoView = ['video', 'timeline'].indexOf(data.previousValue) > 1; wasVideoView = ['video', 'timeline'].indexOf(data.previousValue) > -1;
if (isVideoView != wasVideoView) { if (isVideoView != wasVideoView) {
that[isVideoView ? 'enableItem' : 'disableItem']('showannotations'); that[isVideoView ? 'enableItem' : 'disableItem']('showannotations');
} }