From 2bf15cbf44b6eb9c0350829e8ebc55741f65a302 Mon Sep 17 00:00:00 2001 From: "morse%netscape.com" Date: Fri, 9 Jun 2000 23:55:29 +0000 Subject: [PATCH] start with first element selected (recent regression) --- xpfe/global/resources/content/selectDialog.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xpfe/global/resources/content/selectDialog.js b/xpfe/global/resources/content/selectDialog.js index ebae4f1e9af0..68bc9ae26d34 100644 --- a/xpfe/global/resources/content/selectDialog.js +++ b/xpfe/global/resources/content/selectDialog.js @@ -75,14 +75,17 @@ function selectDialogOnLoad() { listBox = document.getElementById("list"); var numItems = param.GetInt( 2 ) + var firstItem, nextItem; for ( i = 2; i <= numItems+1; i++ ) { var newString = param.GetString( i ); dump("setting string "+newString+"\n"); - AppendStringToTreelist(listBox, newString); + nextItem = AppendStringToTreelist(listBox, newString); + if (i == 2) { + firstItem = nextItem; + } } - dump("number of items "+ listBox.options.length +" "+listBox.length+"\n"); - listBox.selectedIndex = 0; + listBox.selectItem(firstItem); // resize the window to the content window.sizeToContent();