зеркало из https://github.com/mozilla/pjs.git
support refreshing the tree after edits have been made, restoring original selection
This commit is contained in:
Родитель
215c89dbb5
Коммит
094f68c0a0
|
@ -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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче