From 174e0d657bfd7299d3c00f414233bc9f42663da5 Mon Sep 17 00:00:00 2001 From: Bohung Date: Wed, 9 Jun 2021 11:15:46 +0800 Subject: [PATCH] Fix bug. --- app/helpers/announcements_helper.rb | 3 ++- modules/announcement/_annc_widget4.html.erb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/announcements_helper.rb b/app/helpers/announcements_helper.rb index 7002202..520efa0 100644 --- a/app/helpers/announcements_helper.rb +++ b/app/helpers/announcements_helper.rb @@ -193,7 +193,8 @@ module AnnouncementsHelper page_number = 1 if page_number == 0 page_data_count = data_count || OrbitHelper.page_data_count.to_i feeds_anns = [] - page = Page.where(url:params['url']).first + page = OrbitHelper.page rescue nil + page = Page.where(url:params['url']).first if page.nil? if @type == "show_widget" tags = @tags categories = @categories diff --git a/modules/announcement/_annc_widget4.html.erb b/modules/announcement/_annc_widget4.html.erb index 548fcbd..343d53b 100644 --- a/modules/announcement/_annc_widget4.html.erb +++ b/modules/announcement/_annc_widget4.html.erb @@ -78,7 +78,7 @@ for(var i=0;i< lilength -num ; i++) $(v).find('ul.w-annc__list').eq(0).find("li.w-annc__item").eq(num).remove(); }) - $('.widget-announcement-4 ul.w-annc__list >li').css('width','calc('+100/num+'% - '+20/16+'em)'); //20px=>li的margin + $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list >li').css('width','calc('+100/num+'% - '+20/16+'em)'); //20px=>li的margin }; $(window).resize(function(){ if($(window).width()>1024){