From 55ac677d85b86f3486dde27151535a669a80b851 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 26 Mar 2017 11:57:44 +0300 Subject: [PATCH] manage: fixup style search --- manage.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manage.js b/manage.js index 964d36c7..a29855d0 100644 --- a/manage.js +++ b/manage.js @@ -425,20 +425,23 @@ class Updater { function searchStyles({immediately, container}) { const query = $('#search').value.toLocaleLowerCase(); - if (query == (searchStyles.lastQuery || '') && !container) { + if (query == (searchStyles.lastQuery || '') && !immediately && !container) { return; } searchStyles.lastQuery = query; if (!immediately) { clearTimeout(searchStyles.timeout); - searchStyles.timeout = setTimeout(searchStyles, 200, {immediately: true}); + searchStyles.timeout = setTimeout(searchStyles, 150, {immediately: true}); return; } for (const element of (container || installed).children) { const {style} = cachedStyles.byId.get(element.styleId) || {}; if (style) { - const isMatching = !query || isMatchingText(style.name) || isMatchingStyle(style); + const isMatching = !query + || isMatchingText(style.name) + || style.url && isMatchingText(style.url) + || isMatchingStyle(style); element.style.display = isMatching ? '' : 'none'; } }