Class: Maglove::Widget::LegacyRawHtml

Inherits:
V1
  • Object
show all
Defined in:
lib/maglove/widget/raw_html.rb

Instance Attribute Summary

Attributes inherited from Base

#options, #scope

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

#defaultsObject



21
22
23
24
25
26
# File 'lib/maglove/widget/raw_html.rb', line 21

def defaults
  {
    src: "<p>custom html</p>",
    css: nil
  }
end

#identifierObject



17
18
19
# File 'lib/maglove/widget/raw_html.rb', line 17

def identifier
  "raw_html"
end

#render(&block) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/maglove/widget/raw_html.rb', line 28

def render(&block)
  super do
    haml_tag :div, class: "iframe-container", style: style_string(options, :margin, :padding) do
      haml_tag :iframe, src: options[:src], style: options[:css]
    end
  end
end