From acba26fd4a5b9b38249147ca0cf6a70d9d018f08 Mon Sep 17 00:00:00 2001 From: "asqueella%gmail.com" Date: Sat, 17 Feb 2007 19:03:14 +0000 Subject: [PATCH] fix bug 318532 - Lost focus when deleting first item in history sidebar p=David Benes r=both neils (enndeakin, neil@parkwaycc) --- toolkit/obsolete/content/nsTreeController.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/toolkit/obsolete/content/nsTreeController.js b/toolkit/obsolete/content/nsTreeController.js index edb5e0292a8..eeca89f4f43 100644 --- a/toolkit/obsolete/content/nsTreeController.js +++ b/toolkit/obsolete/content/nsTreeController.js @@ -206,11 +206,12 @@ function nsTreeController_delete() } catch (ex) { } } - if (max.value) { - var newIndex = max.value - (max.value - min.value); + if (max.value != -1) { + var newIndex = min.value; if (newIndex >= this.treeView.rowCount) --newIndex; - this.treeSelection.select(newIndex); + if (newIndex >= 0) + this.treeSelection.select(newIndex); } return true; }