manage: apply search filter to edited/updated styles

This commit is contained in:
tophf 2017-04-12 20:22:58 +03:00
parent 4f2ccbe6cb
commit ce2492c305

View File

@ -107,7 +107,7 @@ function showStyles(styles = []) {
break; break;
} }
} }
if ($('#search').value) { if ($('#search').value.trim()) {
// re-apply filtering on history Back // re-apply filtering on history Back
searchStyles({immediately: true, container: renderBin}); searchStyles({immediately: true, container: renderBin});
} }
@ -342,6 +342,11 @@ Object.assign(handleEvent, {
function handleUpdate(style, {reason} = {}) { function handleUpdate(style, {reason} = {}) {
const element = createStyleElement({style}); 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); const oldElement = $('#style-' + style.id, installed);
if (oldElement) { if (oldElement) {
if (oldElement.styleNameLowerCase == element.styleNameLowerCase) { if (oldElement.styleNameLowerCase == element.styleNameLowerCase) {