Skip to content

Commit

Permalink
Merge pull request #215 from magento-south/MAGETWO-35818
Browse files Browse the repository at this point in the history
[South] Bug fixing
  • Loading branch information
AndriyNasinnyk committed Apr 6, 2015
2 parents 85dfbb0 + 768e436 commit 569b0d6
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions app/code/Magento/RequireJs/Block/Html/Head/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,10 @@ public function __construct(
*/
protected function _prepareLayout()
{
$after = RequireJsConfig::REQUIRE_JS_FILE_NAME;
$requireJsConfig = $this->fileManager->createRequireJsConfigAsset();
$assetCollection = $this->pageConfig->getAssetCollection();

$assetCollection->insert(
$requireJsConfig->getFilePath(),
$requireJsConfig,
RequireJsConfig::REQUIRE_JS_FILE_NAME
);

if ($this->bundleConfig->isBundlingJsFiles()) {
$bundleAssets = $this->fileManager->createBundleJsPool();
$staticAsset = $this->fileManager->createStaticJsAsset();
Expand All @@ -81,10 +76,21 @@ protected function _prepareLayout()
RequireJsConfig::REQUIRE_JS_FILE_NAME
);
}
$assetCollection->insert($staticAsset->getFilePath(), $staticAsset, RequireJsConfig::CONFIG_FILE_NAME);
$assetCollection->insert(
$staticAsset->getFilePath(),
$staticAsset,
reset($bundleAssets)->getFilePath()
);
$after = $staticAsset->getFilePath();
}
}

$assetCollection->insert(
$requireJsConfig->getFilePath(),
$requireJsConfig,
$after
);

return parent::_prepareLayout();
}

Expand Down

0 comments on commit 569b0d6

Please sign in to comment.