17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'app/helpers/uploadbox/img_helper.rb', line 17
def img(source, options={})
if source.respond_to?(:url) and source.respond_to?(:width) and source.respond_to?(:height)
if source.processing?
data = {
processing: source.processing?,
original: source.original_file,
component: 'ShowImage'
}
content_tag :div, class: 'uploadbox-image-container uploadbox-processing', style: "width: #{source.width}px; height: #{source.height}px", data: data do
image_tag(source.url, {width: source.width, height: source.height, style: 'display: none'}.merge(options))
end
else
data = {}
content_tag :div, class: 'uploadbox-image-container', width: source.width, height: source.height, data: data do
image_tag(source.url, {width: source.width, height: source.height}.merge(options))
end
end
else
image_tag(source, options)
end
end
|