new editable_text option: inline (line_break won't be longer used)
did
committed Mar 01, 2016
commit fd9635fe6fbe0483423a463f0bbae83edfd55f94
Showing 2
changed files with
5 additions
and 3 deletions
locomotive/steam/liquid/tags/editable/text.rb b/lib/locomotive/steam/liquid/tags/editable/text.rb
+4
-3
| @@ | @@ -44,7 +44,8 @@ module Locomotive |
| content_from_default: self.render_default_content, | |
| format: @element_options[:format] || 'html', | |
| rows: @element_options[:rows] || 10, | |
| - | line_break: @element_options[:line_break].blank? ? true : @element_options[:line_break] |
| + | inline: @element_options[:inline], |
| + | line_break: @element_options[:line_break].blank? ? true : @element_options[:line_break], |
| ) | |
| end | |
| @@ | @@ -67,14 +68,14 @@ module Locomotive |
| super | |
| end | |
| def default_element_attributes | |
| - | super.merge(format: 'raw', rows: 2, line_break: false) |
| + | super.merge(format: 'raw', rows: 2, line_break: false, inline: true) |
| end | |
| end | |
| ::Liquid::Template.register_tag('editable_short_text'.freeze, ShortText) | |
| class LongText < ShortText | |
| def default_element_attributes | |
| - | super.merge(format: 'html', rows: 15, line_break: true) |
| + | super.merge(format: 'html', rows: 15, line_break: true, inline: false) |
| end | |
| end | |
| ::Liquid::Template.register_tag('editable_long_text'.freeze, LongText) | |
spec/unit/liquid/tags/editable/text_spec.rb
+1
-0
| @@ | @@ -62,6 +62,7 @@ describe Locomotive::Steam::Liquid::Tags::Editable::Text do |
| it { is_expected.to include(format: 'html') } | |
| it { is_expected.to include(rows: 10) } | |
| it { is_expected.to include(line_break: true) } | |
| + | it { is_expected.to include(inline: nil) } |
| it { is_expected.to include(content_from_default: 'Hello world') } | |
| context 'with a defined slug' do | |