diff --git a/app/assets/javascripts/templates/partials/shop_variant_no_group_buy.html.haml b/app/assets/javascripts/templates/partials/shop_variant_no_group_buy.html.haml index 0760da7311..bec3b64fdc 100644 --- a/app/assets/javascripts/templates/partials/shop_variant_no_group_buy.html.haml +++ b/app/assets/javascripts/templates/partials/shop_variant_no_group_buy.html.haml @@ -1,15 +1,17 @@ .small-5.medium-3.large-3.columns.variant-quantity-column.text-right{"ng-if" => "::!variant.product.group_buy"} - %button.add-variant{type: "button", ng: {if: "!variant.line_item.quantity", click: "add(1)", disabled: "!canAdd(1)"}} - {{ "js.shopfront.variant.add_to_cart" | t }} - %button.variant-quantity{type: "button", ng: {if: "variant.line_item.quantity", click: "add(-1)"}}> - -# U+FF0D Fullwidth Hyphen-Minus - - - %input.variant-quantity{type: "number", min: "0", max: "{{ available() }}", ng: {model: "variant.line_item.quantity", if: "variant.line_item.quantity"}}> - %button.variant-quantity{type: "button", ng: {if: "variant.line_item.quantity", click: "add(1)", disabled: "!canAdd(1)"}} - -# U+FF0B Fullwidth Plus Sign - + - %br + .variant-quantity-inputs{ng: {if: "!variant.line_item.quantity"}} + %button.add-variant{type: "button", ng: {click: "add(1)", disabled: "!canAdd(1)"}} + {{ "js.shopfront.variant.add_to_cart" | t }} + + .variant-quantity-inputs{ng: {if: "variant.line_item.quantity"}} + %button.variant-quantity{type: "button", ng: {click: "add(-1)"}}> + -# U+FF0D Fullwidth Hyphen-Minus + - + %input.variant-quantity{type: "number", min: "0", max: "{{ available() }}", ng: {model: "variant.line_item.quantity"}}> + %button.variant-quantity{type: "button", ng: {click: "add(1)", disabled: "!canAdd(1)"}} + -# U+FF0B Fullwidth Plus Sign + + .variant-quantity-display{ng: {class: "{visible: variant.line_item.quantity}"}} {{ "js.shopfront.variant.quantity_in_cart" | t:{quantity: variant.line_item.quantity || 0} }} %input{type: :hidden, diff --git a/app/assets/stylesheets/darkswarm/_shop-inputs.scss b/app/assets/stylesheets/darkswarm/_shop-inputs.scss index 90331835aa..e9bc97eb86 100644 --- a/app/assets/stylesheets/darkswarm/_shop-inputs.scss +++ b/app/assets/stylesheets/darkswarm/_shop-inputs.scss @@ -19,6 +19,12 @@ // Components to add variants to cart and change quantities // // They are not nested so that they can be used in modals. + +.variant-quantity-inputs { + height: 2.5rem; + white-space: nowrap; +} + button.add-variant, button.variant-quantity { height: 2.5rem; border-radius: 0;