Bug 234973 - Make selected row visible after removing/editing entries in password manager. r?dolske
Added a call to
'treeBoxObject.ensureRowIsVisible(signonsTree.view.selection.currentIndex)' in
'signonReloadDisplay()' to make sure the selection is visible regardless of the
operation which caused a call to signonReloadDisplay().
MozReview-Commit-ID: EztJ4sZcofi
--- a/toolkit/components/passwordmgr/content/passwordManager.js
+++ b/toolkit/components/passwordmgr/content/passwordManager.js
@@ -46,16 +46,17 @@ let signonReloadDisplay = {
return;
}
signons.length = 0;
LoadSignons();
// apply the filter if needed
if (filterField && filterField.value != "") {
FilterPasswords();
}
+ signonsTree.treeBoxObject.ensureRowIsVisible(signonsTree.view.selection.currentIndex);
break;
}
Services.obs.notifyObservers(null, "passwordmgr-dialog-updated", null);
}
}
};
// Formatter for localization.
@@ -384,17 +385,16 @@ function DeleteSignon() {
}
}
// update selection and/or buttons
if (table.length) {
// update selection
let nextSelection = (selections[0] < table.length) ? selections[0] : table.length - 1;
tree.view.selection.select(nextSelection);
- tree.treeBoxObject.ensureRowIsVisible(nextSelection);
} else {
// disable buttons
removeButton.setAttribute("disabled", "true");
removeAllButton.setAttribute("disabled", "true");
}
tree.view.selection.selectEventsSuppressed = false;
FinalizeSignonDeletions(syncNeeded);
}