From 13b739c446a019438fcf5096c7e9cefdbc169c30 Mon Sep 17 00:00:00 2001 From: "ben%netscape.com" Date: Wed, 3 May 2000 01:38:19 +0000 Subject: [PATCH] some tweaks/polish for profile manager --- profile/resources/content/createProfileWizard.xul | 2 +- profile/resources/content/profileManager.js | 8 +++++++- profile/resources/content/profileSelection.js | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/profile/resources/content/createProfileWizard.xul b/profile/resources/content/createProfileWizard.xul index 571a6c4b71b9..afa3693b16b3 100644 --- a/profile/resources/content/createProfileWizard.xul +++ b/profile/resources/content/createProfileWizard.xul @@ -23,7 +23,7 @@ - + diff --git a/profile/resources/content/profileManager.js b/profile/resources/content/profileManager.js index 52e3e2c9c55a..31ed1a96bc89 100644 --- a/profile/resources/content/profileManager.js +++ b/profile/resources/content/profileManager.js @@ -37,7 +37,10 @@ function CreateProfileWizard() function CreateProfile( aProfName, aProfDir ) { var profile = new Profile( aProfName, aProfDir, "yes" ); - AddItem( "profilekids", profile ); + var item = AddItem( "profilekids", profile ); + var profileTree = document.getElementById( "profiles" ); + if( item ) + profileTree.selectItem( item ); } // rename the selected profile @@ -142,6 +145,7 @@ function DeleteProfile( deleteFiles ) var profileTree = document.getElementById( "profiles" ); var profileKids = document.getElementById( "profilekids" ) var selected = profileTree.selectedItems[0]; + var firstAdjacent = selected.previousSibling; var name = selected.getAttribute( "rowName" ); try { profile.deleteProfile( name, deleteFiles ); @@ -152,6 +156,8 @@ function DeleteProfile( deleteFiles ) lString = lString.replace(/\s*/g,"\n"); alert( lString ); } + if( firstAdjacent ) + profileTree.selectCell( firstAdjacent ); // set the button state DoEnabling(); } diff --git a/profile/resources/content/profileSelection.js b/profile/resources/content/profileSelection.js index 98e468f8661c..cf70731719ec 100644 --- a/profile/resources/content/profileSelection.js +++ b/profile/resources/content/profileSelection.js @@ -58,7 +58,8 @@ function highlightCurrentProfile() return; var currentProfileItem = document.getElementById( ( "profileName_" + currentProfile ) ); var profileList = document.getElementById( "profiles" ); - profileList.selectItem( currentProfileItem ); + if( currentProfileItem ) + profileList.selectItem( currentProfileItem ); } catch(e) { dump("*** failed to select current profile in list\n"); @@ -85,6 +86,7 @@ function AddItem( aChildren, aProfileObject ) // var roaming = document.getElementById("roamingitem"); // kids.insertBefore(item,roaming); kids.appendChild(item); + return item; } function Profile ( aName, aDir, aMigrated )