fix USO-archive site search link

This commit is contained in:
tophf 2021-09-08 19:13:27 +03:00
parent e7d5fff736
commit 59cac7a469
2 changed files with 6 additions and 2 deletions

View File

@ -91,7 +91,7 @@ async function initPopup(frames) {
setupLivePrefs();
Object.assign($('#find-styles-link'), {
href: URLS.usoArchive,
href: URLS.usoArchive + 'browse/styles',
async onclick(e) {
e.preventDefault();
await require(['/popup/search']);

View File

@ -85,7 +85,11 @@
if (!prefs.get('popup.findStylesInline') || dom.container) {
// use a less specific category if the inline search wasn't used yet
if (!category) calcCategory({retry: 1});
a.search = new URLSearchParams({category, search: $('#search-query').value});
const search = [
category ? '#' + category : '',
$('#search-query').value,
].filter(Boolean).join(' ');
a.search = search ? 'search=' + encodeURIComponent(search) : '';
Events.openURLandHide.call(a, event);
return;
}