Merge pull request #1956 from open-sausages/pulls/4.0/unique-icons-css

BUG Prevent icons CSS being included twice
This commit is contained in:
Chris Joe 2017-10-05 10:21:08 +13:00 committed by GitHub
commit 06dcc42fc0
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);
} }
/** /**