fixes for editing categories in calendar prefs

bugs 254613, 254614 and 256984, r=mostafah
This commit is contained in:
mvl%exedo.nl 2004-08-26 14:20:31 +00:00
parent dedf389ac9
commit 7131178596

View File

@ -126,7 +126,7 @@
function editCategory()
{
var list = document.getElementById("catergorieslist");
if (list.selectedIndex) {
if (list.selectedItem) {
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
var result = {value: gCategoryList[list.selectedIndex]};
@ -144,8 +144,10 @@
function deleteCategory()
{
var list = document.getElementById("catergorieslist");
gCategoryList.splice(list.selectedIndex, 1);
updateCategoryList();
if (list.selectedItem) {
gCategoryList.splice(list.selectedIndex, 1);
updateCategoryList();
}
}
/*
@ -185,9 +187,9 @@
<checkbox id="reloadonlaunch" preftype="bool" prefstring="calendar.servers.reloadonlaunch" label="&pref.reloadonlaunch;" />
</groupbox>
<groupbox>
<groupbox flex="1">
<caption label="&pref.categories.label;"/>
<hbox>
<hbox flex="1">
<listbox flex="1" id="catergorieslist"/>
<vbox>
<spacer flex="1"/>