Commit 3ec7ffcb by lmf

Merge branch 'master' of http://47.99.244.21:9999/root/joshine

parents b7d64c51 f9e53aae
......@@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Theme\Block\Html;
use Magento\Backend\Model\Menu;
......@@ -57,7 +58,8 @@ class Topmenu extends Template implements IdentityInterface
NodeFactory $nodeFactory,
TreeFactory $treeFactory,
array $data = []
) {
)
{
parent::__construct($context, $data);
$this->nodeFactory = $nodeFactory;
$this->treeFactory = $treeFactory;
......@@ -192,9 +194,82 @@ class Topmenu extends Template implements IdentityInterface
$colStops = $this->_columnBrake($child->getChildren(), $limit);
}
$html .= '<ul class="level' . $childLevel . ' ' . $childrenWrapClass . '">';
$html .= $this->_getHtml($child, $childrenWrapClass, $limit, $colStops);
$html .= '</ul>';
if ($child->getData('name') == 'TOPS') {
$html .= '<div class="level' . $childLevel . ' ' . $childrenWrapClass . '">';
// $html .= $this->_getHtml($child, $childrenWrapClass, $limit, $colStops);
$html .= '1222';
$html .= '</div>';
} elseif ($child->getData('name') == 'BODYSUITS') {
$html .= '<div class="level' . $childLevel . ' ' . $childrenWrapClass . '">';
$html .= '<div class="row">';
$html .= '<ul class="subchildmenu col-sm-12 mega-columns columns4">';
$html .= $this->_getHtmlStyle1($child, $childrenWrapClass, $limit, $colStops);
$html .= '</ul>';
$html .= '</div>';
$html .= '</div>';
} else {
$html .= '<ul class="level' . $childLevel . ' ' . $childrenWrapClass . '">';
// $html .= $this->_getHtml($child, $childrenWrapClass, $limit, $colStops);
$html .= '33333';
$html .= '</ul>';
}
return $html;
}
protected function _getHtmlStyle1(Node $menuTree,
$childrenWrapClass,
$limit,
array $colBrakes = []
)
{
$html = '';
$children = $menuTree->getChildren();
$childLevel = $this->getChildLevel($menuTree->getLevel());
$this->removeChildrenWithoutActiveParent($children, $childLevel);
$counter = 1;
$childrenCount = $children->count();
$parentPositionClass = $menuTree->getPositionClass();
$itemPositionClassPrefix = $parentPositionClass ? $parentPositionClass . '-' : 'nav-';
/** @var Node $child */
foreach ($children as $child) {
$child->setLevel($childLevel);
$child->setIsFirst($counter === 1);
$child->setIsLast($counter === $childrenCount);
$child->setPositionClass($itemPositionClassPrefix . $counter);
$outermostClassCode = '';
$outermostClass = $menuTree->getOutermostClass();
if ($childLevel === 0 && $outermostClass) {
$outermostClassCode = ' class="' . $outermostClass . '" ';
$this->setCurrentClass($child, $outermostClass);
}
if ($this->shouldAddNewColumn($colBrakes, $counter)) {
$html .= '</ul></li><li class="column"><ul>';
}
$html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
$html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>' . $this->escapeHtml(
$child->getName()
) . '</span></a>' . $this->_addSubMenu(
$child,
$childLevel,
$childrenWrapClass,
$limit
) . '</li>';
$counter++;
}
if (is_array($colBrakes) && !empty($colBrakes) && $limit) {
$html = '<li class="column"><ul>' . $html . '</ul></li>';
}
return $html;
}
......@@ -213,7 +288,8 @@ class Topmenu extends Template implements IdentityInterface
$childrenWrapClass,
$limit,
array $colBrakes = []
) {
)
{
$html = '';
$children = $menuTree->getChildren();
......@@ -247,13 +323,13 @@ class Topmenu extends Template implements IdentityInterface
$html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
$html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>' . $this->escapeHtml(
$child->getName()
) . '</span></a>' . $this->_addSubMenu(
$child,
$childLevel,
$childrenWrapClass,
$limit
) . '</li>';
$child->getName()
) . '</span></a>' . $this->_addSubMenu(
$child,
$childLevel,
$childrenWrapClass,
$limit
) . '</li>';
$counter++;
}
......
......@@ -15,7 +15,7 @@ $_menuHtml = $block->getHtml('level-top', 'submenu', $columnsLimit)
?>
<div class="nav-sections">
<nav class="navigation" data-action="navigation">
<ul data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'>
<ul data-mage-init='{"menu":{"responsive":true,"dropdown":"div", "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'>
<?= /* @noEscape */ $_menuHtml?>
<?= $block->getChildHtml() ?>
</ul>
......
......@@ -942,9 +942,35 @@ footer{
background:none;
}
.submenu{
//width: 100%;
width: 100%;
margin-top: 16px;
padding: 60px 30px 60px 20px;
}
.subchildmenu.mega-columns > li{
float: left;
}
.navigation li.level0 .submenu .level1{
border-right: 1px solid #e1e1e1;
}
.navigation .subchildmenu.mega-columns.columns4 > li{
width: 25%;
}
.navigation .subchildmenu.mega-columns.columns4 > li:nth-child(4n+1){
clear: both;
}
.navigation .submenu li.level1 > a{
font-size: 14px;
font-weight: 500;
text-transform: uppercase;
}
.navigation .submenu li.level1 > a > span{
font-family: 'Outfit-Regular', sans-serif;
position: relative;
font-weight: 500;
color: #292929;
text-transform: none;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment