module Maglove module Widgets class ScrollableImage < Base def identifier "scrollable_image" end def defaults { source: false, show_navigation: true, height: "400px", margin_bottom: "0px" } end def template(&block) 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] 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 end end