lib/maglove/widgets/container.rb in maglove-widgets-1.1.7 vs lib/maglove/widgets/container.rb in maglove-widgets-1.1.8
- old
+ new
@@ -10,10 +10,11 @@
animate: "none",
image_source: false,
image_position: "center_center",
image_size: "cover",
parallax_effect: "none",
+ parallax_speed: 0.6,
background_color: "",
bg_color: "",
opacity: "",
border_radius: "",
border_width: "",
@@ -36,11 +37,14 @@
}
end
def container_options
result = { class: container_classes, style: container_styles }
- result["data-parallax-style"] = @options[:parallax_effect] if !@options[:parallax_effect].empty? and @options[:parallax_effect] != "none"
+ if !@options[:parallax_effect].empty? and @options[:parallax_effect] != "none"
+ result["data-parallax-style"] = @options[:parallax_effect]
+ result["data-parallax-speed"] = @options[:parallax_speed]
+ end
result
end
def image_options
{ class: "one-container-image", style: image_styles }
@@ -77,14 +81,10 @@
else
@options[:margin_left] = "auto"
@options[:margin_right] = "auto"
end
- style_string @options, :min_height, :max_height, :max_width, :padding, :overflow_y, :margin_left, :margin_right do |sb|
- if @options[:parallax_effect] != "none"
- sb.add(:background_image, @options[:image_source], "url(<%= value %>)")
- end
- end
+ style_string @options, :min_height, :max_height, :max_width, :padding, :overflow_y, :margin_left, :margin_right
end
module Helpers
def container_widget(options = {}, &block)
widget_block(Widgets::Container.new(options)) do |widget|
\ No newline at end of file