Mobile image

This commit is contained in:
manson 2014-05-29 17:39:10 +08:00
parent cff99db899
commit 302a2af898
1 changed files with 2 additions and 1 deletions

View File

@ -2,10 +2,11 @@ class AdBannersController < ApplicationController
def widget def widget
adbanner = Banner.find(OrbitHelper.widget_custom_value) adbanner = Banner.find(OrbitHelper.widget_custom_value)
images = adbanner.ad_images.collect.with_index do |b,i| images = adbanner.ad_images.collect.with_index do |b,i|
image_link = OrbitHelper.is_mobile_view ? b.file.mobile.url : b.file.url
klass = i == 0 ? "active" : "" klass = i == 0 ? "active" : ""
caption = i == 0 ? '<div class="cycle-overlay"></div><div class="cycle-pager"></div>' : "" caption = i == 0 ? '<div class="cycle-overlay"></div><div class="cycle-pager"></div>' : ""
{ {
"image_link" => b.file.url, "image_link" => image_link,
"title" => b.title, "title" => b.title,
"class" => klass, "class" => klass,
"height" => adbanner.height, "height" => adbanner.height,