From 4177a24add475cdbdde694a8b49afc5c7799d984 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Fri, 17 Nov 2000 23:20:26 +0000 Subject: [PATCH] fix for #60523. make sure that the current profile is visible on startup and any newly created profile is visible after creation. sr=alecf --- profile/resources/content/profileManager.js | 8 ++++++-- profile/resources/content/profileSelection.js | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/profile/resources/content/profileManager.js b/profile/resources/content/profileManager.js index a88f0d4ac1dd..0e66b9a82b6f 100644 --- a/profile/resources/content/profileManager.js +++ b/profile/resources/content/profileManager.js @@ -42,8 +42,10 @@ function CreateProfile( aProfName, aProfDir ) var profile = new Profile( aProfName, aProfDir, "yes" ); var item = AddItem( "profilekids", profile ); var profileTree = document.getElementById( "profiles" ); - if( item ) + if( item ) { profileTree.selectItem( item ); + profileTree.ensureElementIsVisible( item ); + } } // rename the selected profile @@ -154,8 +156,10 @@ function DeleteProfile( deleteFiles ) } catch (ex) { } - if( firstAdjacent ) + if( firstAdjacent ) { profileTree.selectItem( firstAdjacent ); + profileTree.ensureElementIsVisible( firstAdjacent ); + } // set the button state DoEnabling(); } diff --git a/profile/resources/content/profileSelection.js b/profile/resources/content/profileSelection.js index 4eb2890b1148..344cd6ae8826 100644 --- a/profile/resources/content/profileSelection.js +++ b/profile/resources/content/profileSelection.js @@ -85,8 +85,10 @@ function highlightCurrentProfile() return; var currentProfileItem = document.getElementById( ( "profileName_" + currentProfile ) ); var profileList = document.getElementById( "profiles" ); - if( currentProfileItem ) + if( currentProfileItem ) { profileList.selectItem( currentProfileItem ); + profileList.ensureElementIsVisible( currentProfileItem ); + } } catch(e) { dump("*** failed to select current profile in list\n");