From 6d57b745873f23b3004b1128e5c80552c086fc3d Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 8 Apr 2015 19:33:31 -0700 Subject: [PATCH] CRM-16145 - Angular - Don't aggregate CSS files The main pain-point is decomposing and then aggregating JS files. CSS files are a smaller issue, and they have harsher requirements because CSS files may include file-path-expressions (which need to be filtered during aggregation). --- Civi/Angular/Page/Main.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Civi/Angular/Page/Main.php b/Civi/Angular/Page/Main.php index ed7140751f..c8f7a258c8 100644 --- a/Civi/Angular/Page/Main.php +++ b/Civi/Angular/Page/Main.php @@ -86,9 +86,9 @@ class Main extends \CRM_Core_Page { // FIXME: crmUi depends on loading ckeditor, but ckeditor doesn't work with this aggregation. $this->res->addScriptFile('civicrm', 'packages/ckeditor/ckeditor.js', 100, 'page-header', FALSE); + $headOffset = 0; $config = \CRM_Core_Config::singleton(); if ($config->debug) { - $headOffset = 0; foreach ($modules as $moduleName => $module) { foreach ($this->angular->getResources($moduleName, 'css', 'cacheUrl') as $url) { $this->res->addStyleUrl($url, self::DEFAULT_MODULE_WEIGHT + (++$headOffset), 'html-header'); @@ -106,8 +106,13 @@ class Main extends \CRM_Core_Page { $aggScriptUrl = \CRM_Utils_System::url('civicrm/ajax/angular-modules', 'format=js&r=' . $page->res->getCacheCode(), FALSE, NULL, FALSE); $this->res->addScriptUrl($aggScriptUrl, 120, 'html-header'); - $aggStyleUrl = \CRM_Utils_System::url('civicrm/ajax/angular-modules', 'format=css&r=' . $page->res->getCacheCode(), FALSE, NULL, FALSE); - $this->res->addStyleUrl($aggStyleUrl, 120, 'html-header'); + // FIXME: The following CSS aggregator doesn't currently handle path-adjustments - which can break icons. + //$aggStyleUrl = \CRM_Utils_System::url('civicrm/ajax/angular-modules', 'format=css&r=' . $page->res->getCacheCode(), FALSE, NULL, FALSE); + //$this->res->addStyleUrl($aggStyleUrl, 120, 'html-header'); + + foreach ($this->angular->getResources(array_keys($modules), 'css', 'cacheUrl') as $url) { + $this->res->addStyleUrl($url, self::DEFAULT_MODULE_WEIGHT + (++$headOffset), 'html-header'); + } } } -- 2.25.1