зеркало из https://github.com/mozilla/gecko-dev.git
Fix for Bug 182642: Title of the "Available Profiles" listbox can be
deleted with the "Delete Profile" button r=jag, sr=alecf
This commit is contained in:
Родитель
9e13ed7b74
Коммит
844f914326
|
@ -201,21 +201,25 @@ function DeleteProfile( deleteFiles )
|
||||||
var profileList = document.getElementById("profiles");
|
var profileList = document.getElementById("profiles");
|
||||||
if (profileList.selectedItems && profileList.selectedItems.length) {
|
if (profileList.selectedItems && profileList.selectedItems.length) {
|
||||||
var selected = profileList.selectedItems[0];
|
var selected = profileList.selectedItems[0];
|
||||||
var firstAdjacent = selected.previousSibling;
|
|
||||||
var name = selected.getAttribute("rowName");
|
var name = selected.getAttribute("rowName");
|
||||||
|
var previous = profileList.getPreviousItem(selected, 1);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
profile.deleteProfile(name, deleteFiles);
|
profile.deleteProfile(name, deleteFiles);
|
||||||
profileList.removeChild(selected);
|
profileList.removeChild(selected);
|
||||||
|
|
||||||
|
if (previous) {
|
||||||
|
profileList.selectItem(previous);
|
||||||
|
profileList.ensureElementIsVisible(previous);
|
||||||
}
|
}
|
||||||
catch (ex) {
|
|
||||||
}
|
|
||||||
if( firstAdjacent ) {
|
|
||||||
profileList.selectItem( firstAdjacent );
|
|
||||||
profileList.ensureElementIsVisible( firstAdjacent );
|
|
||||||
}
|
|
||||||
// set the button state
|
// set the button state
|
||||||
DoEnabling();
|
DoEnabling();
|
||||||
}
|
}
|
||||||
|
catch (ex) {
|
||||||
|
dump("Exception during profile deletion.\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function ConfirmMigrateAll()
|
function ConfirmMigrateAll()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче