From 545fa1acfc76958fdb5e15e55830266232350dee Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 13 Oct 2011 10:19:56 +0000 Subject: [PATCH] fix bugs with enabling/disabling the showannotations entry in the view menu --- static/js/pandora/ui/menu.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/static/js/pandora/ui/menu.js b/static/js/pandora/ui/menu.js index 7a33bde65..6cc05d861 100644 --- a/static/js/pandora/ui/menu.js +++ b/static/js/pandora/ui/menu.js @@ -265,10 +265,15 @@ pandora.ui.mainMenu = function() { that[data.value ? 'disableItem' : 'enableItem']('showgroups'); 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) { - var isVideoView = ['video', 'timeline'].indexOf(data.value) > 1, - wasVideoView = ['video', 'timeline'].indexOf(data.previousValue) > 1; + var isVideoView = ['video', 'timeline'].indexOf(data.value) > -1, + wasVideoView = ['video', 'timeline'].indexOf(data.previousValue) > -1; if (isVideoView != wasVideoView) { that[isVideoView ? 'enableItem' : 'disableItem']('showannotations'); }