class Maglove::Widget::LegacyScrollableImage

Public Instance Methods

defaults() click to toggle source
# File lib/maglove/widget/scrollable_image.rb, line 22
def defaults
  {
    source: false,
    show_navigation: true,
    height: "400px",
    margin_bottom: "0px"
  }
end
identifier() click to toggle source
# File lib/maglove/widget/scrollable_image.rb, line 18
def identifier
  "scrollable_image"
end
render() { || ... } click to toggle source
Calls superclass method Maglove::Widget::V1#render
# File lib/maglove/widget/scrollable_image.rb, line 31
def render(&block)
  super do
    haml_tag :div, class: "scrollable-image-container #{options[:show_navigation] ? 'show-navigation' : ''}", style: style_string(options, :margin, :padding, :height) do
      haml_tag :div, class: "scrollable-image-inner" do
        haml_tag :img, class: "scrollable-image", src: options[:source]
        yield if block
      end
      if options[:show_navigation]
        haml_tag :div, class: "scrollable-image-navigator scrollable-image-navigator-left"
        haml_tag :div, class: "scrollable-image-navigator scrollable-image-navigator-right"
      end
    end
  end
end