mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-02 12:32:55 +00:00
support refreshing the tree after edits have been made, restoring original selection
This commit is contained in:
parent
ecd029955b
commit
2abee07bcb
@ -132,7 +132,21 @@ function refreshFilterList() {
|
||||
var tree = document.getElementById("filterTree");
|
||||
if (!tree) return;
|
||||
|
||||
var selection;
|
||||
|
||||
var selectedItems = tree.selectedItems;
|
||||
if (selectedItems && selectedItems.length >0)
|
||||
selection = tree.selectedItems[0].id;
|
||||
|
||||
tree.clearItemSelection();
|
||||
tree.clearCellSelection();
|
||||
tree.setAttribute("ref", tree.getAttribute("ref"));
|
||||
|
||||
if (selection) {
|
||||
var newItem = document.getElementById(selection);
|
||||
tree.selectItem(newItem);
|
||||
tree.ensureElementIsVisible(newItem);
|
||||
}
|
||||
}
|
||||
|
||||
function updateButtons()
|
||||
|
Loading…
x
Reference in New Issue
Block a user