properly enable/disable options in personal lists menu (fixes #746)

This commit is contained in:
rolux 2012-04-19 09:04:25 +00:00
parent 82e75fa10c
commit 2b3f487c4c

View file

@ -28,10 +28,10 @@ pandora.ui.folders = function() {
]; ];
} else { } else {
extras = [ extras = [
pandora.$ui.personalListsSelect = Ox.MenuButton({ pandora.$ui.personalListsMenu = Ox.MenuButton({
items: [ items: [
{ id: 'newlist', title: 'New List' }, { 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: 'newsmartlist', title: 'New Smart List' },
{ id: 'newsmartlistfromresults', title: 'New Smart List from Results' }, { id: 'newsmartlistfromresults', title: 'New Smart List from Results' },
{}, {},
@ -60,21 +60,21 @@ pandora.ui.folders = function() {
} }
}, },
pandora_find: function() { pandora_find: function() {
/*
var action = ui._list var action = ui._list
&& pandora.getListData(ui._list).user == pandora.user.username && pandora.getListData(ui._list).user == pandora.user.username
? 'enableItem' : 'disableItem'; ? 'enableItem' : 'disableItem';
pandora.$ui.personalListsSelect[action]('editlist'); // fixme: duplicated
pandora.$ui.personalListsSelect[action]('duplicatelist'); pandora.$ui.personalListsMenu[action]('editlist');
pandora.$ui.personalListsSelect[action]('deletelist'); pandora.$ui.personalListsMenu[action]('duplicatelist');
pandora.$ui.personalListsSelect[ui.listSelection.length ? 'enableItem' : 'disableItem']('newlistfromselection'); pandora.$ui.personalListsMenu[action]('deletelist');
*/ pandora.$ui.personalListsMenu[
ui.listSelection.length ? 'enableItem' : 'disableItem'
]('newlistfromselection');
}, },
pandora_listselection: function(data) { pandora_listselection: function(data) {
/* pandora.$ui.personalListsMenu[
Ox.Log('', 'pandora_listselection', data.value.length) data.value.length ? 'enableItem' : 'disableItem'
pandora.$ui.personalListsSelect[data.value.length ? 'enableItem' : 'disableItem']('newlistfromselection'); ]('newlistfromselection');
*/
} }
}) })
]; ];