From 17f289f68fc970473f9c4056f54736f4e4dc0d60 Mon Sep 17 00:00:00 2001 From: Matt Dunn-Rankin Date: Mon, 9 Jan 2017 11:16:38 -0800 Subject: [PATCH] whoops, dont trigger autofilter checkbox if we *only* collapsed spaces --- app/assets/javascripts/outfits/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {