Module: Spotlight::JcropHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/spotlight/jcrop_helper.rb

Overview

JCrop options helpers

Instance Method Summary collapse

Instance Method Details

#default_masthead_jcrop_optionsObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/spotlight/jcrop_helper.rb', line 5

def default_masthead_jcrop_options
  {
    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_optionsObject



31
32
33
34
35
# File 'app/helpers/spotlight/jcrop_helper.rb', line 31

def default_site_thumbnail_jcrop_options
  w, h = Spotlight::Engine.config.featured_image_square_size

  default_thumbnail_jcrop_options.merge(aspect_ratio: w.to_f / h.to_f)
end

#default_thumbnail_jcrop_optionsObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/helpers/spotlight/jcrop_helper.rb', line 17

def default_thumbnail_jcrop_options
  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