From 2b3f487c4c1decbff92f2ee9d5455bb3674a384e Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 19 Apr 2012 09:04:25 +0000 Subject: [PATCH] properly enable/disable options in personal lists menu (fixes #746) --- static/js/pandora/folders.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/static/js/pandora/folders.js b/static/js/pandora/folders.js index 4f0c17d71..5a5457366 100644 --- a/static/js/pandora/folders.js +++ b/static/js/pandora/folders.js @@ -28,10 +28,10 @@ pandora.ui.folders = function() { ]; } else { extras = [ - pandora.$ui.personalListsSelect = Ox.MenuButton({ + pandora.$ui.personalListsMenu = Ox.MenuButton({ items: [ { id: 'newlist', title: 'New List' }, - { id: 'newlistfromselection', title: 'New List from Selection...', disabled: ui.listSelection.length == 0 }, + { id: 'newlistfromselection', title: 'New List from Selection', disabled: ui.listSelection.length == 0 }, { id: 'newsmartlist', title: 'New Smart List' }, { id: 'newsmartlistfromresults', title: 'New Smart List from Results' }, {}, @@ -60,21 +60,21 @@ pandora.ui.folders = function() { } }, pandora_find: function() { - /* var action = ui._list && pandora.getListData(ui._list).user == pandora.user.username ? 'enableItem' : 'disableItem'; - pandora.$ui.personalListsSelect[action]('editlist'); - pandora.$ui.personalListsSelect[action]('duplicatelist'); - pandora.$ui.personalListsSelect[action]('deletelist'); - pandora.$ui.personalListsSelect[ui.listSelection.length ? 'enableItem' : 'disableItem']('newlistfromselection'); - */ + // fixme: duplicated + pandora.$ui.personalListsMenu[action]('editlist'); + pandora.$ui.personalListsMenu[action]('duplicatelist'); + pandora.$ui.personalListsMenu[action]('deletelist'); + pandora.$ui.personalListsMenu[ + ui.listSelection.length ? 'enableItem' : 'disableItem' + ]('newlistfromselection'); }, pandora_listselection: function(data) { - /* - Ox.Log('', 'pandora_listselection', data.value.length) - pandora.$ui.personalListsSelect[data.value.length ? 'enableItem' : 'disableItem']('newlistfromselection'); - */ + pandora.$ui.personalListsMenu[ + data.value.length ? 'enableItem' : 'disableItem' + ]('newlistfromselection'); } }) ];