Bug 383723 - "Clearing the sort filter in the Cookies dialog makes the data become unsorted and the selection is lost" [p=ehsan.akhgari@gmail.com (Ehsan Akhgari) r+a1.9=mconnor]

This commit is contained in:
reed%reedloden.com 2007-11-23 01:43:15 +00:00
Родитель 65eb6d6f99
Коммит e53b9ccdae
1 изменённых файлов: 16 добавлений и 1 удалений

Просмотреть файл

@ -21,6 +21,7 @@
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
# Ehsan Akhgari <ehsan.akhgari@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@ -63,6 +64,8 @@ var gCookiesWindow = {
this.sort("rawHost");
if (this._view.rowCount > 0)
this._tree.view.selection.select(0);
this._saveState();
document.getElementById("filter").focus();
},
@ -781,6 +784,17 @@ var gCookiesWindow = {
// Just reload the list to make sure deletions are respected
this._loadCookies();
this._tree.treeBoxObject.view = this._view;
// Restore sort order
var sortby = this._lastSortProperty;
if (sortby == "") {
this._lastSortAscending = false;
this.sort("rawHost");
}
else {
this._lastSortAscending = !this._lastSortAscending;
this.sort(sortby);
}
// Restore open state
for (var i = 0; i < this._openIndices.length; ++i)
@ -891,7 +905,8 @@ var gCookiesWindow = {
onFilterKeyPress: function (aEvent)
{
if (aEvent.keyCode == 27) // ESC key
var filter = document.getElementById("filter").value;
if (aEvent.keyCode == 27 && filter != "") // ESC key
this.clearFilter();
},