diff --git a/CHANGELOG.md b/CHANGELOG.md index b19dc87f7f..50f15e1a14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Open correct product page tabs when URL contains a fragment identifier referring to that content [#1304](https://github.com/bigcommerce/cornerstone/pull/1304) - Display product reviews in tabbed content region of product page. [#1302](https://github.com/bigcommerce/cornerstone/pull/1302) - Show bulk discounts only if enabled through store settings. [#1310](https://github.com/bigcommerce/cornerstone/pull/1310) +- Style active section in search results. [#1316](https://github.com/bigcommerce/cornerstone/pull/1316) ## 2.2.1 (2018-07-10) - Fix wishlist dropdown background color bleeding out of container [#1283](https://github.com/bigcommerce/cornerstone/pull/1283) diff --git a/assets/js/theme/search.js b/assets/js/theme/search.js index 50843f878d..5484d671fb 100644 --- a/assets/js/theme/search.js +++ b/assets/js/theme/search.js @@ -42,6 +42,12 @@ export default class Search extends CatalogPage { this.$facetedSearchContainer.removeClass('u-hiddenVisually'); this.$contentResultsContainer.addClass('u-hiddenVisually'); + $('[data-content-results-toggle]').removeClass('navBar-action-color--active'); + $('[data-content-results-toggle]').addClass('navBar-action'); + + $('[data-product-results-toggle]').removeClass('navBar-action'); + $('[data-product-results-toggle]').addClass('navBar-action-color--active'); + urlUtils.goToUrl(url); } @@ -54,6 +60,12 @@ export default class Search extends CatalogPage { this.$productListingContainer.addClass('u-hiddenVisually'); this.$facetedSearchContainer.addClass('u-hiddenVisually'); + $('[data-product-results-toggle]').removeClass('navBar-action-color--active'); + $('[data-product-results-toggle]').addClass('navBar-action'); + + $('[data-content-results-toggle]').removeClass('navBar-action'); + $('[data-content-results-toggle]').addClass('navBar-action-color--active'); + urlUtils.goToUrl(url); }