Class: Foliokit::Overlay::OverlayButton

Inherits:
OverlayBase show all
Defined in:
lib/foliokit/overlay/overlay_button.rb

Instance Attribute Summary

Attributes inherited from OverlayBase

#section_index, #state

Instance Method Summary collapse

Methods inherited from OverlayBase

element_base, #initialize, #stateful?

Methods included from Modules::Element

#initialize

Constructor Details

This class inherits a constructor from Foliokit::Overlay::OverlayBase

Instance Method Details

#export(document, options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/foliokit/overlay/overlay_button.rb', line 11

def export(document, options = {})
  node = super(document, options)
  if source.present?
    src = package.apply_asset(node, "source", source)
    node["style"] ||= ""
    node["style"] = [node["style"], "background-image: url(#{src})"].join(";")
  end
  node["swipable"] = true
  node["touchable"] = true
  node
end

#tagnameObject



7
8
9
# File 'lib/foliokit/overlay/overlay_button.rb', line 7

def tagname
  "a"
end