Closes #244, Export Collection... and Create Bibliography from Collection... contextual menu options should be disabled for empty collections

This commit is contained in:
Dan Stillman 2006-08-30 17:16:33 +00:00
parent 4f5ac31891
commit 77b594f447

View file

@ -385,6 +385,15 @@ var ScholarPane = new function()
{
var hide = [4,6,9,11,12];
var show = [3,5,7,8,10];
if (itemsView.rowCount>0)
{
var enable = [8,10];
}
else
{
var disable = [8,10];
}
}
// Saved Search
else if (collectionsView.selection.count == 1 &&
@ -392,6 +401,14 @@ var ScholarPane = new function()
{
var hide = [3,5,8,10,12];
var show = [4,6,7,9,11];
if (itemsView.rowCount>0)
{
var enable = [9,11];
}
else
{
var disable = [9,11];
}
}
// Library
else
@ -400,6 +417,16 @@ var ScholarPane = new function()
var show = [12];
}
for (var i in disable)
{
menu.childNodes[disable[i]].setAttribute('disabled', true);
}
for (var i in enable)
{
menu.childNodes[enable[i]].setAttribute('disabled', false);
}
for (var i in hide)
{
menu.childNodes[hide[i]].setAttribute('hidden', true);