diff --git a/vendor/magento/module-catalog/Plugin/Block/Topmenu.php b/vendor/magento/module-catalog/Plugin/Block/Topmenu.php index b4aa5bd960b0..3a76c554aa08 100644 --- a/vendor/magento/module-catalog/Plugin/Block/Topmenu.php +++ b/vendor/magento/module-catalog/Plugin/Block/Topmenu.php @@ -12,13 +12,12 @@ use Magento\Framework\Data\Tree\Node; /** - * Plugin for top menu block + * Plugin that enhances the top menu block by building and managing the category tree + * for menu rendering in a storefront. */ class Topmenu { /** - * Catalog category - * * @var \Magento\Catalog\Helper\Category */ protected $catalogCategory; @@ -33,29 +32,21 @@ class Topmenu */ private $storeManager; - /** - * @var \Magento\Catalog\Model\Layer\Resolver - */ - private $layerResolver; - /** * Initialize dependencies. * * @param \Magento\Catalog\Helper\Category $catalogCategory * @param \Magento\Catalog\Model\ResourceModel\Category\StateDependentCollectionFactory $categoryCollectionFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Model\Layer\Resolver $layerResolver */ public function __construct( \Magento\Catalog\Helper\Category $catalogCategory, \Magento\Catalog\Model\ResourceModel\Category\StateDependentCollectionFactory $categoryCollectionFactory, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Layer\Resolver $layerResolver + \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->catalogCategory = $catalogCategory; $this->collectionFactory = $categoryCollectionFactory; $this->storeManager = $storeManager; - $this->layerResolver = $layerResolver; } /** @@ -78,7 +69,6 @@ public function beforeGetHtml( $storeId = $this->storeManager->getStore()->getId(); /** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $collection */ $collection = $this->getCategoryTree($storeId, $rootId); - $currentCategory = $this->getCurrentCategory(); $mapping = [$rootId => $subject->getMenu()]; // use nodes stack to avoid recursion foreach ($collection as $category) { $categoryParentId = $category->getParentId(); @@ -97,7 +87,6 @@ public function beforeGetHtml( $categoryNode = new Node( $this->getCategoryAsArray( $category, - $currentCategory, $category->getParentId() == $categoryParentId ), 'id', @@ -132,39 +121,20 @@ public function beforeGetIdentities(\Magento\Theme\Block\Html\Topmenu $subject) } } - /** - * Get current Category from catalog layer - * - * @return \Magento\Catalog\Model\Category - */ - private function getCurrentCategory() - { - $catalogLayer = $this->layerResolver->get(); - - if (!$catalogLayer) { - return null; - } - - return $catalogLayer->getCurrentCategory(); - } - /** * Convert category to array * - * @param \Magento\Catalog\Model\Category $category - * @param \Magento\Catalog\Model\Category $currentCategory + * @param Category $category * @param bool $isParentActive * @return array */ - private function getCategoryAsArray($category, $currentCategory, $isParentActive) + private function getCategoryAsArray($category, $isParentActive): array { $categoryId = $category->getId(); return [ 'name' => $category->getName(), 'id' => 'category-node-' . $categoryId, 'url' => $this->catalogCategory->getCategoryUrl($category), - 'has_active' => in_array((string)$categoryId, explode('/', (string)$currentCategory->getPath()), true), - 'is_active' => $categoryId == $currentCategory->getId(), 'is_category' => true, 'is_parent_active' => $isParentActive ]; @@ -196,22 +166,4 @@ protected function getCategoryTree($storeId, $rootId) return $collection; } - - /** - * Add active - * - * @param \Magento\Theme\Block\Html\Topmenu $subject - * @param string[] $result - * @return string[] - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function afterGetCacheKeyInfo(\Magento\Theme\Block\Html\Topmenu $subject, array $result) - { - $activeCategory = $this->getCurrentCategory(); - if ($activeCategory) { - $result[] = Category::CACHE_TAG . '_' . $activeCategory->getId(); - } - - return $result; - } } diff --git a/vendor/magento/module-product-video/view/frontend/web/js/fotorama-add-video-events.js b/vendor/magento/module-product-video/view/frontend/web/js/fotorama-add-video-events.js index 670d91febe9f..2198549b2a1a 100644 --- a/vendor/magento/module-product-video/view/frontend/web/js/fotorama-add-video-events.js +++ b/vendor/magento/module-product-video/view/frontend/web/js/fotorama-add-video-events.js @@ -122,7 +122,7 @@ define([ isFullscreen: false, FTCF: '[data-gallery-role="fotorama__fullscreen-icon"]', Base: 0, //on check for video is base this setting become true if there is any video with base role - MobileMaxWidth: 768, + MobileMaxWidth: 767, GP: 'gallery-placeholder', //gallery placeholder class is needed to find and erase