Module: Spotlight::JcropHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/spotlight/jcrop_helper.rb
Overview
JCrop options helpers
Instance Method Summary collapse
- #default_masthead_jcrop_options ⇒ Object
- #default_site_thumbnail_jcrop_options ⇒ Object
- #default_thumbnail_jcrop_options ⇒ Object
Instance Method Details
#default_masthead_jcrop_options ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/helpers/spotlight/jcrop_helper.rb', line 5 def { croppable: true, selector: 'masthead_image', bg_color: 'black', bg_opacity: '.4', aspect_ratio: 10, box_width: '600', initial_set_select: '[0, 0, 1800, 180]' } end |
#default_site_thumbnail_jcrop_options ⇒ Object
31 32 33 34 35 |
# File 'app/helpers/spotlight/jcrop_helper.rb', line 31 def w, h = Spotlight::Engine.config.featured_image_square_size .merge(aspect_ratio: w.to_f / h.to_f) end |
#default_thumbnail_jcrop_options ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/helpers/spotlight/jcrop_helper.rb', line 17 def w, h = Spotlight::Engine.config.featured_image_thumb_size { croppable: true, selector: 'featuredimage_image', bg_color: 'black', bg_opacity: '.4', box_width: '600', aspect_ratio: w.to_f / h.to_f, initial_set_select: '[0, 0, 100000, 100000]' } end |