From dc1dd2e2439fb0859967482dff5f8dc5078a5924 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 13 Mar 2015 16:06:46 +1100 Subject: [PATCH] Changing the class .filter-box for shopfront to .filter-shopfront This prevents the issue with inheritance / styling crossover --- .../darkswarm/directives/single_line_selector.coffee | 2 +- app/assets/javascripts/templates/product_modal.html.haml | 8 -------- app/assets/stylesheets/darkswarm/_shop-filters.css.sass | 6 ++++-- .../stylesheets/darkswarm/active_table_search.css.sass | 7 +------ app/views/shop/products/_filters.html.haml | 4 ++-- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/darkswarm/directives/single_line_selector.coffee b/app/assets/javascripts/darkswarm/directives/single_line_selector.coffee index 53ef2f9e9e..0c4e4b42d7 100644 --- a/app/assets/javascripts/darkswarm/directives/single_line_selector.coffee +++ b/app/assets/javascripts/darkswarm/directives/single_line_selector.coffee @@ -35,7 +35,7 @@ Darkswarm.directive 'singleLineSelectors', ($timeout, $filter) -> fit = -> used = $(element).find("li.more").outerWidth(true) - available = $(element).parent(".filter-box").innerWidth() + available = $(element).parent(".filter-shopfront").innerWidth() $(element).find("li").not(".more").each (i) -> used += $(this).outerWidth(true) scope.allSelectors[i].fits = used <= available diff --git a/app/assets/javascripts/templates/product_modal.html.haml b/app/assets/javascripts/templates/product_modal.html.haml index f472d9285a..88e3c58d66 100644 --- a/app/assets/javascripts/templates/product_modal.html.haml +++ b/app/assets/javascripts/templates/product_modal.html.haml @@ -6,14 +6,6 @@ %em from %span.avenir {{ enterprise.name }} - .filter-box.taxon-selectors - %div{ objects: "[product] | taxonsOf"} - - %hr - - .filter-box.property-selectors - %single-line-selectors{ objects: "[product] | propertiesOf"} - / %render-svg{path: "{{product.primary_taxon.icon}}"} diff --git a/app/assets/stylesheets/darkswarm/_shop-filters.css.sass b/app/assets/stylesheets/darkswarm/_shop-filters.css.sass index 13aba876a6..e68dc9985b 100644 --- a/app/assets/stylesheets/darkswarm/_shop-filters.css.sass +++ b/app/assets/stylesheets/darkswarm/_shop-filters.css.sass @@ -11,6 +11,8 @@ margin: 0 0 0.25rem 0.25rem &:hover, &:focus background: transparent + &.active + box-shadow: none a @include border-radius(0.5em) @@ -69,7 +71,7 @@ span.filter-label opacity: 0.75 -.filter-box.taxon-selectors, .filter-box.property-selectors +.filter-shopfront.taxon-selectors, .filter-shopfront.property-selectors background: transparent single-line-selectors @@ -86,7 +88,7 @@ list-style: none -.filter-box +.filter-shopfront // Shopfront taxons &.taxon-selectors @include filter-selector($clr-blue, $clr-blue-light, $clr-blue-bright) diff --git a/app/assets/stylesheets/darkswarm/active_table_search.css.sass b/app/assets/stylesheets/darkswarm/active_table_search.css.sass index d19f116139..49981895d0 100644 --- a/app/assets/stylesheets/darkswarm/active_table_search.css.sass +++ b/app/assets/stylesheets/darkswarm/active_table_search.css.sass @@ -8,7 +8,7 @@ margin-left: 0 margin-right: 0 -.row.filter-box:first-child, .row.filter-box.filter-box-shopfront +.row.filter-box:first-child border: 1px solid $clr-blue-light @include border-radius(0.25em) margin-top: 2px @@ -19,11 +19,6 @@ background: transparent margin-top: 1em -.row.filter-box.filter-box-shopfront - margin-top: 0 - background: transparent - border: 0 none - products .filter-box background: #f7f7f7 diff --git a/app/views/shop/products/_filters.html.haml b/app/views/shop/products/_filters.html.haml index 9a1eeba931..7e9fc6555d 100644 --- a/app/views/shop/products/_filters.html.haml +++ b/app/views/shop/products/_filters.html.haml @@ -1,5 +1,5 @@ -.filter-box.taxon-selectors.animate-hide.text-right +.filter-shopfront.taxon-selectors.animate-hide.text-right %single-line-selectors{ objects: "Products.products | products:query | taxonsOf", "active-selectors" => "activeTaxons"} -.filter-box.property-selectors.animate-hide.text-right +.filter-shopfront.property-selectors.animate-hide.text-right %single-line-selectors{ objects: "Products.products | products:query | propertiesOf", "active-selectors" => "activeProperties"}