lib/caisson/helpers/orbit_slider.rb in caisson-0.0.2 vs lib/caisson/helpers/orbit_slider.rb in caisson-0.0.3
- old
+ new
@@ -17,31 +17,17 @@
end
private
def build_options(options)
- # DEPRECATED IN VERSION 4
options.reverse_merge(
- advance_speed: 4000,
- animation: "horizontal-push",
animation_speed: 400,
bullets: false,
- bullet_thumbs: false,
- bullet_thumbs_location: '',
- caption_animation: 'fade',
- caption_animation_speed: 800,
- captions: false,
class: 'slider',
columns_per_slide: 1,
- directional_nav: true,
- fluid: '16x5',
id: "slider-#{rand(10000)}",
- pause_on_hover: true,
- reset_timer_on_click: false,
- start_clock_on_mouse_out: true,
- start_clock_on_mouse_out_after: 1000,
- timer: false)
+ timer_speed: 0)
end
def build_item(item, last=false, &block)
'<li>' + capture(item, &block).to_s + '</li>'
@@ -49,11 +35,11 @@
def build_slides(&block)
slides = []
@items.each_slice @options[:columns_per_slide] do |slice|
- content = '<li><div class="spacer"></div><ul class="wink small-block-grid-3 large-block-grid-' + @options[:columns_per_slide].to_s + '">'
+ content = '<li><div class="spacer"></div><ul class="items small-block-grid-3 large-block-grid-' + @options[:columns_per_slide].to_s + '">'
slice.each_with_index { |item,i| content << build_item(item, (i==slice.length-1), &block) }
content << '</ul><div class="spacer"></div></li>'
slides << content
end
@@ -70,11 +56,11 @@
end
def stringify_options
results = []
- @options.each { |k,v| results << "#{k}:#{v};" }
+ @options.each { |k,v| results << "#{k}:#{v};" if not [:class, :columns_per_slide, :id].include? k }
return results.join
end
def wrap_slider(content)
@@ -82,11 +68,10 @@
@options.each do |k,v|
case k.to_s
when 'id' then attributes[:id] = v
when 'class' then attributes[:class] = ['slider', v].compact.join(' ')
- when 'columns_per_slide' then nil
- else nil #attributes["data-#{k}".gsub('_', '-')] = parse_attribute_value(v)
+ else nil
end
end
return content_tag(:ul, content.html_safe, attributes)
end