Bug 230108 Deleting account gives spurious error message p=stefan@borggraafe.com r=me sr=bienvenu

git-svn-id: svn://10.0.0.236/trunk@150921 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
neil%parkwaycc.co.uk
2004-01-06 16:34:27 +00:00
parent dc82c0f246
commit 47b04e617b

View File

@@ -175,6 +175,7 @@ function selectServer(server, selectPage)
var index = accounttree.contentView.getIndexOfItem(selectedItem);
accounttree.treeBoxObject.selection.select(index);
accounttree.treeBoxObject.ensureRowIsVisible(index);
var lastItem = selectedServer.lastChild.lastChild;
if (lastItem.localName == "treeitem")
@@ -698,33 +699,23 @@ function setEnabled(control, enabled)
control.setAttribute("disabled", true);
}
// this is a workaround for bug #51546
// the on click handler is getting called twice
var bug51546CurrentPage = null;
var bug51546CurrentServerId = null;
//
// called when someone clicks on an account
// figure out context by what they clicked on
// Called when someone clicks on an account. Figure out context by what they
// clicked on. This is also called when an account is removed. In this case,
// nothing is selected.
//
function onAccountClick(tree) {
//dump("onAccountClick()\n");
function onAccountClick(tree)
{
var currentSelection = getServerIdAndPageIdFromTree(tree);
var result = getServerIdAndPageIdFromTree(tree);
//dump("sputter:"+bug51546CurrentPage+","+bug51546CurrentServerId+":"+result.pageId+","+result.serverId+"\n");
if ((bug51546CurrentPage == result.pageId) && (bug51546CurrentServerId == result.serverId)) {
//dump("workaround for #51546\n");
// Nothing is selected. This is the case when an account was removed.
// A call of selectServer(null,null) after the removal ensures that
// onAccountClick() is called again after that with a valid selection.
if (!currentSelection)
return;
}
bug51546CurrentPage = result.pageId;
bug51546CurrentServerId = result.serverId;
if (result) {
showPage(result.serverId, result.pageId);
updateButtons(tree,result.serverId);
}
showPage(currentSelection.serverId, currentSelection.pageId);
updateButtons(tree, currentSelection.serverId);
}
// show the page for the given server:
@@ -800,7 +791,8 @@ function loadPage(pageId)
{
chromePackageName = "messenger";
}
document.getElementById("contentFrame").setAttribute("src","chrome://" + chromePackageName + "/content/" + pageId);
const LOAD_FLAGS_NONE = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE;
document.getElementById("contentFrame").webNavigation.loadURI("chrome://" + chromePackageName + "/content/" + pageId, LOAD_FLAGS_NONE, null, null, null);
}
//