remember sort order in popup, use "updated" by default

This commit is contained in:
tophf 2021-04-18 17:06:08 +03:00
parent a32adf1c32
commit ee43d6adaf
2 changed files with 4 additions and 2 deletions

View File

@ -37,6 +37,8 @@
'popup.autoResort': false, // auto resort styles after toggling
'popup.borders': false, // add white borders on the sides
'popup.findStylesInline': true, // use the inline style search
/** @type {'n' | 'u' | 't' | 'w' | 'r'} see IndexEntry */
'popup.findSort': 'u', // the inline style search sort order
'manage.onlyEnabled': false, // display only enabled styles
'manage.onlyLocal': false, // display only styles created locally

View File

@ -48,8 +48,7 @@
let searchGlobals = $('#search-globals').checked;
/** @type string[] */
let query = [];
/** @type 'n' | 'u' | 't' | 'w' | 'r' */
let order = 't';
let order = prefs.get('popup.findSort');
let scrollToFirstResult = true;
let displayedPage = 1;
let totalPages = 1;
@ -103,6 +102,7 @@
$('#search-order').value = order;
$('#search-order').onchange = function () {
order = this.value;
prefs.set('popup.findSort', order);
results.sort(comparator);
render();
};