зеркало из https://github.com/mozilla/pjs.git
fixing bug 130982 - delete/move context menu command attempts to restore focus to invalid row. r=bhuvan sr=sspitzer
This commit is contained in:
Родитель
f2241ba056
Коммит
abd5d148c5
|
@ -34,6 +34,8 @@ function RestoreSelectionWithoutContentLoad(outliner)
|
|||
var outlinerBoxObj = outliner.outlinerBoxObject;
|
||||
var outlinerSelection = outlinerBoxObj.selection;
|
||||
|
||||
// make sure that currentIndex is valid so that we don't try to restore
|
||||
// a selection of an invalid row.
|
||||
if((!outlinerSelection.isSelected(outlinerSelection.currentIndex)) &&
|
||||
(outlinerSelection.currentIndex >= 0))
|
||||
{
|
||||
|
|
|
@ -900,6 +900,8 @@ function ChangeSelectionWithoutContentLoad(event, outliner)
|
|||
var outlinerSelection = outlinerBoxObj.selection;
|
||||
|
||||
outlinerBoxObj.getCellAt(event.clientX, event.clientY, row, col, elt);
|
||||
// make sure that row.value is valid so that it doesn't mess up
|
||||
// the call to ensureRowIsVisible().
|
||||
if((row.value >= 0) && !outlinerSelection.isSelected(row.value))
|
||||
{
|
||||
var saveCurrentIndex = outlinerSelection.currentIndex;
|
||||
|
|
|
@ -305,6 +305,9 @@ function GetThreadPaneFolder()
|
|||
|
||||
function EnsureRowInThreadOutlinerIsVisible(index)
|
||||
{
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
var outliner = GetThreadOutliner();
|
||||
outliner.boxObject.QueryInterface(Components.interfaces.nsIOutlinerBoxObject).ensureRowIsVisible(index);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче