From ebf3a2eae451ec7e38fcfd1e21533322f90999f3 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Thu, 1 Mar 2012 10:57:13 +0800 Subject: [PATCH] Fix extra loaded js: the widgets only need to render layout when they need js. --- app/controllers/obit_frontend_component_controller.rb | 2 +- .../panel/announcement/widget/bulletins_controller.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/obit_frontend_component_controller.rb b/app/controllers/obit_frontend_component_controller.rb index d0be3a25..2c44b60c 100644 --- a/app/controllers/obit_frontend_component_controller.rb +++ b/app/controllers/obit_frontend_component_controller.rb @@ -1,7 +1,7 @@ class ObitFrontendComponentController< ApplicationController before_filter :setup_vars before_filter {|c| c.front_end_available(@app_title)} - layout 'module_widget' + layout :false def setup_vars @app_title = request.fullpath.split('/')[2] diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb index 6695156a..333f88e7 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb @@ -28,6 +28,7 @@ class Panel::Announcement::Widget::BulletinsController < ObitWidgetController @selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0] @bulletins = @selected_tag.get_visible_bulletins.page(params[:page]).per(5) rescue nil @web_links = WebResourceTag.first(:conditions => {:en => @selected_tag[:en]}).get_visible_links.page(params[:page]).per(5) rescue nil + render :layout => 'module_widget' end def reload_bulletins