From ce2492c3050cce192c9396272068f9ecbe3bcf0a Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 12 Apr 2017 20:22:58 +0300 Subject: [PATCH] manage: apply search filter to edited/updated styles --- manage.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manage.js b/manage.js index 657cfa4a..79039377 100644 --- a/manage.js +++ b/manage.js @@ -107,7 +107,7 @@ function showStyles(styles = []) { break; } } - if ($('#search').value) { + if ($('#search').value.trim()) { // re-apply filtering on history Back searchStyles({immediately: true, container: renderBin}); } @@ -342,6 +342,11 @@ Object.assign(handleEvent, { function handleUpdate(style, {reason} = {}) { const element = createStyleElement({style}); + if ($('#search').value.trim()) { + const renderBin = document.createDocumentFragment(); + renderBin.appendChild(element); + searchStyles({immediately: true, container: renderBin}); + } const oldElement = $('#style-' + style.id, installed); if (oldElement) { if (oldElement.styleNameLowerCase == element.styleNameLowerCase) {