lib/rails-gallery/view_helper/responsive.rb in rails-gallery-0.2.1 vs lib/rails-gallery/view_helper/responsive.rb in rails-gallery-0.3.0

- old
+ new

@@ -1,9 +1,32 @@ module RailsGallery module ViewHelper module Responsive - def responsive_gallery_image photo - image_tag photo.thumb, :"data-large" => "/assets/#{photo.path}", :alt => photo.alt, :"data-description" => photo.title + def respgal_image photo, options = {} + options.merge! :alt => photo.alt + options.merge! :"data-large" => photo.path, :"data-description" => photo.title + return image_tag photo.thumb, options unless options.delete :wrap + + content_tag :li do + content_tag :a, href: '#' do + image_tag(photo.thumb, options) + end + end end + + def respgal_imageset photo, options = {} + options.merge! :alt => photo.alt + options.merge! :"data-large" => photo.path, :"data-description" => photo.title + options.merge! :srcset => srcset if photo.srcset? + return imageset_tag photo.thumb, options unless options.delete :wrap + + content_tag :li do + content_tag :a, href: '#' do + imageset_tag(photo.thumb, options) + end + end + end + alias_method :responsive_gallery_image, :respgal_image + alias_method :responsive_gallery_imageset, :respgal_imageset end end end