Class: Maglove::Widget::V1
Direct Known Subclasses
LegacyButton, LegacyCard, LegacyColumns, LegacyContainer, LegacyHeading, LegacyHorizontalRule, LegacyImage, LegacyListitem, LegacyPage, LegacyParagraph, LegacyProperty, LegacyRawHtml, LegacyScrollableImage, LegacySlider, LegacyVideo, LegacyYoutube
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#defaults, #identifier, #initialize, #style_string
Constructor Details
This class inherits a constructor from Maglove::Widget::Base
Instance Method Details
#drop_container ⇒ Object
78 79 80 |
# File 'lib/maglove/widget.rb', line 78 def drop_container haml_tag :div, class: '_typeloft_widget_drop_container' end |
#render(&block) ⇒ Object
72 73 74 75 76 |
# File 'lib/maglove/widget.rb', line 72 def render(&block) haml_tag :div, do yield self if block_given? end end |
#widget_options ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/maglove/widget.rb', line 56 def attributes = { :class => "_typeloft_widget", :"data-widget-identifier" => identifier } @options.each do |k, v| if [:padding, :margin].include?(k) [:top, :right, :bottom, :left].each do |dir| attributes["data-attribute-#{k}_#{dir}"] = v end end attributes["data-attribute-#{k}"] = v end attributes end |