From 126beae8ffa3fda207d329c194cc6e038c965154 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 11 Nov 2013 16:44:50 +0800 Subject: [PATCH] small fix for banner pagination. --- app/views/front/show_banner.html.erb | 8 +++++++- config/mongoid.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/front/show_banner.html.erb b/app/views/front/show_banner.html.erb index 11017d440..37cb4e9d5 100644 --- a/app/views/front/show_banner.html.erb +++ b/app/views/front/show_banner.html.erb @@ -1,5 +1,5 @@
-
+
<% @ad_banner.ad_images.can_display.each do |ad_image| %> <% link = ad_image_link(ad_image) %> <%= image_tag ad_image.file, width: @ad_banner.width, height: @ad_banner.height, link_open: ad_image.link_open, link_url: link, style: "display:none; #{'cursor:pointer;' if link.present?}" %> @@ -17,6 +17,12 @@ <% end %> $.preload(a, 2, function(){ $('.orbit-cycle-slideshow').cycle(); + var lis = $("ul.banner_nav_<%= @ad_banner.title.dehumanize %> li"); + if( lis.length > a.length ){ + for( i = lis.length - 1; i > a.length - 1; i-- ){ + lis[i].remove(); + } + } }); } else{ diff --git a/config/mongoid.yml b/config/mongoid.yml index d20c47270..ebfecd6ef 100644 --- a/config/mongoid.yml +++ b/config/mongoid.yml @@ -8,7 +8,7 @@ defaults: &defaults development: <<: *defaults - database: orbit_site_new + database: test_site