Class: Maglove::Widget::LegacyHeading
- Defined in:
- lib/maglove/widget/heading.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from V1
#drop_container, #widget_options
Methods inherited from Base
#initialize, #style_string, #widget_options
Constructor Details
This class inherits a constructor from Maglove::Widget::Base
Instance Method Details
#defaults ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/maglove/widget/heading.rb', line 24 def defaults { type: "h1", style: "default", align: "left", margin_bottom: "1em", line_height: nil, letter_spacing: nil, id: nil } end |
#identifier ⇒ Object
20 21 22 |
# File 'lib/maglove/widget/heading.rb', line 20 def identifier "heading" end |
#render(&block) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/maglove/widget/heading.rb', line 36 def render(&block) super do haml_tag :header, id: [:id].to_s, class: "#{options[:style]} align-#{options[:align]}", style: style_string(, :margin, :padding) do haml_tag [:type], class: "_typeloft_editable _typeloft_widget_autoselect", style: style_string(, :line_height, :letter_spacing) do yield self if block_given? end end end end |