Index: chrome/content/ui/filters-filterview.js |
=================================================================== |
--- a/chrome/content/ui/filters-filterview.js |
+++ b/chrome/content/ui/filters-filterview.js |
@@ -457,24 +457,32 @@ var FilterView = |
FilterView.addDummyRow(); |
this.selectRow(position); |
} |
}, |
/** |
* Selects a row in the tree and makes sure it is visible. |
+ * @param {number} row |
+ * row index |
+ * @param {boolean} [scrollToTop] |
+ * if true, the selected row should become the top row of the list if |
+ * possible, otherwise the list is only scrolled if the row isn't visible. |
*/ |
- selectRow: function(row) |
+ selectRow: function(row, scrollToTop) |
{ |
if (this.selection) |
{ |
row = Math.min(Math.max(row, 0), this.data.length - 1); |
this.selection.select(row); |
- this.boxObject.ensureRowIsVisible(row); |
+ if (scrollToTop) |
+ this.boxObject.scrollToRow(row); |
+ else |
+ this.boxObject.ensureRowIsVisible(row); |
} |
}, |
/** |
* Finds a particular filter in the list and selects it. |
*/ |
selectFilter: function(/**Filter*/ filter) |
{ |
@@ -484,17 +492,17 @@ var FilterView = |
if (this.data[i].filter == filter) |
{ |
index = i; |
break; |
} |
} |
if (index >= 0) |
{ |
- this.selectRow(index); |
+ this.selectRow(index, true); |
Wladimir Palant
2016/10/14 08:12:12
Selecting a filter (typically when coming from blo
|
this.treeElement.focus(); |
} |
}, |
/** |
* Updates value of data property on sorting or filter subscription changes. |
*/ |
updateData: function() |