From fb427244300747b3a7bfea81220ee43ca733b67a Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 19 Feb 2014 11:56:10 +1100 Subject: [PATCH] Remove entire field div instead of just the text field --- .../hide_unit_option_types.html.haml.deface | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/overrides/spree/admin/variants/_form/hide_unit_option_types.html.haml.deface b/app/overrides/spree/admin/variants/_form/hide_unit_option_types.html.haml.deface index 8facf38294..16a0e572b4 100644 --- a/app/overrides/spree/admin/variants/_form/hide_unit_option_types.html.haml.deface +++ b/app/overrides/spree/admin/variants/_form/hide_unit_option_types.html.haml.deface @@ -1,9 +1,10 @@ -/ replace_contents "[data-hook='presentation']" +/ replace "[data-hook='presentation']" -= label :new_variant, option.option_type.presentation -- if @variant.new_record? - = select(:new_variant, option.option_type.presentation, option.option_type.option_values.collect {|ov| [ ov.presentation, ov.id ] }, {}, {:class => 'select2 fullwidth'}) -- else - - opt = @variant.option_values.detect {|o| o.option_type == option.option_type }.try(:presentation) - - if opt && !variant_unit_option_type?(option.option_type) - = text_field(:new_variant, option.option_type.presentation, :value => opt, :disabled => 'disabled', :class => 'fullwidth') +- unless variant_unit_option_type?(option.option_type) + .field{"data-hook" => "presentation"} + = label :new_variant, option.option_type.presentation + - if @variant.new_record? + = select(:new_variant, option.option_type.presentation, option.option_type.option_values.collect {|ov| [ ov.presentation, ov.id ] }, {}, {:class => 'select2 fullwidth'}) + - else + - if opt = @variant.option_values.detect {|o| o.option_type == option.option_type }.try(:presentation) + = text_field(:new_variant, option.option_type.presentation, :value => opt, :disabled => 'disabled', :class => 'fullwidth')