Fix language navigation up/down button edge cases.

b=120382; r=law; sr=hewitt
This commit is contained in:
sgehani%netscape.com 2006-05-17 02:32:34 +00:00
Родитель b895a3967f
Коммит 7cdaaa1c20
1 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -523,6 +523,20 @@ function MoveUp() {
}
}
if (active_languages.selectedIndex == 0)
{
// selected item is first
var moveUp = document.getElementById("up");
moveUp.disabled = true;
}
if (active_languages_treeroot.childNodes.length > 1)
{
// more than one item so we can move selected item back down
var moveDown = document.getElementById("down");
moveDown.disabled = false;
}
UpdateSavePrefString();
} //MoveUp
@ -543,6 +557,21 @@ function MoveDown() {
}
}
if (active_languages.selectedIndex ==
(active_languages_treeroot.childNodes.length - 1))
{
// selected item is last
var moveDown = document.getElementById("down");
moveDown.disabled = true;
}
if (active_languages_treeroot.childNodes.length > 1)
{
// more than one item so we can move selected item back up
var moveUp = document.getElementById("up");
moveUp.disabled = false;
}
UpdateSavePrefString();
} //MoveDown