From b2e29526ff233ade8bb6a988482e152bb740b0a7 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 29 Jul 2014 14:55:48 +1000 Subject: [PATCH] FIX: custom css not using CDN --- app/models/site_customization.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/models/site_customization.rb b/app/models/site_customization.rb index 1a7c453b421..1dbc796ebb6 100644 --- a/app/models/site_customization.rb +++ b/app/models/site_customization.rb @@ -179,14 +179,19 @@ class SiteCustomization < ActiveRecord::Base return "" unless stylesheet.present? return @stylesheet_link_tag if @stylesheet_link_tag ensure_stylesheets_on_disk! - @stylesheet_link_tag = "" + @stylesheet_link_tag = link_css_tag "/#{CACHE_PATH}#{stylesheet_filename}?#{stylesheet_hash}" end def mobile_stylesheet_link_tag return "" unless mobile_stylesheet.present? return @mobile_stylesheet_link_tag if @mobile_stylesheet_link_tag ensure_stylesheets_on_disk! - @mobile_stylesheet_link_tag = "" + @mobile_stylesheet_link_tag = link_css_tag "/#{CACHE_PATH}#{stylesheet_filename(:mobile)}?#{stylesheet_hash(:mobile)}" + end + + def link_css_tag(href) + href = (GlobalSetting.cdn_url || "") + href + %Q{} end end