BUG Prevent icons CSS being included twice

This commit is contained in:
Damian Mooyman 2017-09-07 12:36:26 +12:00 committed by Christopher Joe
parent 46e2b19337
commit 49fd3391fe
2 changed files with 6 additions and 2 deletions

View File

@ -80,6 +80,10 @@ use Translatable;
*/ */
class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionProvider class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionProvider
{ {
/**
* Unique ID for page icons CSS block
*/
const PAGE_ICONS_ID = 'PageIcons';
private static $url_segment = 'pages'; private static $url_segment = 'pages';
@ -167,7 +171,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
Requirements::javascript('silverstripe/cms: client/dist/js/bundle.js'); Requirements::javascript('silverstripe/cms: client/dist/js/bundle.js');
Requirements::javascript('silverstripe/cms: client/dist/js/SilverStripeNavigator.js'); Requirements::javascript('silverstripe/cms: client/dist/js/SilverStripeNavigator.js');
Requirements::css('silverstripe/cms: client/dist/styles/bundle.css'); Requirements::css('silverstripe/cms: client/dist/styles/bundle.css');
Requirements::customCSS($this->generatePageIconsCss()); Requirements::customCSS($this->generatePageIconsCss(), self::PAGE_ICONS_ID);
$module = ModuleLoader::getModule('silverstripe/cms'); $module = ModuleLoader::getModule('silverstripe/cms');
Requirements::add_i18n_javascript($module->getRelativeResourcePath('client/lang'), false, true); Requirements::add_i18n_javascript($module->getRelativeResourcePath('client/lang'), false, true);

View File

@ -17,7 +17,7 @@ class LeftAndMainPageIconsExtension extends Extension
public function init() public function init()
{ {
Requirements::customCSS($this->generatePageIconsCss()); Requirements::customCSS($this->generatePageIconsCss(), CMSMain::PAGE_ICONS_ID);
} }
/** /**