Reset integrations search to all if search input is emptied (#15165)

Co-authored-by: Richard Leurs <7275740+EarthlingRich@users.noreply.github.com>
This commit is contained in:
Richard Leurs 2020-10-10 19:11:24 +02:00 committed by GitHub
parent d37ee6c97b
commit 9b24adc108
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,10 +263,13 @@ allComponents.pop(); // remove placeholder element at the end
var text = $(this).val();
// sanitize input
text = text.replace(/[(\?|\&\{\}\(\))]/gi, '').trim();
if (typeof text === "string" && text.length !== 0) {
if (typeof text === "string" && text.length >= 1) {
updateHash('#search/' + text);
applyFilter();
}
else {
updateHash('#all');
}
applyFilter();
}, 500));
window.addEventListener('hashchange', applyFilter);