diff --git a/app/assets/javascripts/outfits/edit.js b/app/assets/javascripts/outfits/edit.js index 0cdb9879..fa169300 100644 --- a/app/assets/javascripts/outfits/edit.js +++ b/app/assets/javascripts/outfits/edit.js @@ -1355,12 +1355,12 @@ View.Search = function (wardrobe) { function updateQuery() { var human_query = typeof current_query === 'string' ? current_query : ''; var autofilterClause = buildAutofilterClause(); + var autofilterPresent = human_query.indexOf(autofilterClause) >= 0; var queryWithoutAutofilterClause = human_query .replace(autofilterClause, '') // remove autofilter clause .replace(/^\s+/, '') // remove leading spaces .replace(/\s+$/, '') // remove trailing spaces .replace(/\s+/g, ' '); // collapse spaces - var autofilterPresent = human_query !== queryWithoutAutofilterClause; if (autofilterPresent) { $('#preview-search-autofilter').attr('checked', 'checked'); } else if (current_query.length > 0) {