Class: Maglove::Widget::LegacyScrollableImage
- Defined in:
- lib/maglove/widget/scrollable_image.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
22 23 24 25 26 27 28 29 |
# File 'lib/maglove/widget/scrollable_image.rb', line 22 def defaults { source: false, show_navigation: true, height: "400px", margin_bottom: "0px" } end |
#identifier ⇒ Object
18 19 20 |
# File 'lib/maglove/widget/scrollable_image.rb', line 18 def identifier "scrollable_image" end |
#render(&block) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/maglove/widget/scrollable_image.rb', line 31 def render(&block) super do haml_tag :div, class: "scrollable-image-container #{[:show_navigation] ? 'show-navigation' : ''}", style: style_string(, :margin, :padding, :height) do haml_tag :div, class: "scrollable-image-inner" do haml_tag :img, class: "scrollable-image", src: [:source] yield if block end if [: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 |