From bbd11adefa838080be36dd98909442b8592534dd Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 24 Sep 2015 20:18:15 -0700 Subject: [PATCH] collapse search on empty string --- app/assets/javascripts/outfits/edit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/outfits/edit.js b/app/assets/javascripts/outfits/edit.js index 543d9795..5c256237 100644 --- a/app/assets/javascripts/outfits/edit.js +++ b/app/assets/javascripts/outfits/edit.js @@ -1173,7 +1173,9 @@ View.Search = function (wardrobe) { form.submit(function (e) { e.preventDefault(); - current_query = addAutofilter($(this).find('input[name=query]').val()); + var given_query = $(this).find('input[name=query]').val(); + if (given_query) given_query = addAutofilter(given_query); + current_query = given_query; wrapper.removeClass('advanced'); loadPage(1); });