Commit 7d23a121 authored by Hoto Cocoa's avatar Hoto Cocoa

Fix navbar root menu not working with single dropdown menu

parent 51096c79
Pipeline #32080156 passed with stage
in 2 minutes and 2 seconds
......@@ -667,7 +667,6 @@ class LibertyTemplate extends BaseTemplate {
/**
* Render Portal function, build top menu contents.
* @todo Fix parser to remove `count( $content['children'] ) > 2`
* @param array $contents Menu data that will made by parseNavbar function.
*/
protected function renderPortal( $contents ) {
......@@ -680,7 +679,7 @@ class LibertyTemplate extends BaseTemplate {
'class' => [ 'dropdown', 'nav-item' ]
] );
array_push( $content['classes'], 'nav-link' );
if ( is_array( $content['children'] ) && count( $content['children'] ) > 2 ) {
if ( is_array( $content['children'] ) && count( $content['children'] ) ) {
array_push( $content['classes'], 'dropdown-toggle', 'dropdown-toggle-fix' );
}
......@@ -705,7 +704,7 @@ class LibertyTemplate extends BaseTemplate {
}
echo Html::closeElement( 'a' );
if ( is_array( $content['children'] ) && count( $content['children'] ) > 2 ) {
if ( is_array( $content['children'] ) && count( $content['children'] ) ) {
// We should fix this
array_shift( $content['children'] );
echo Html::openElement( 'div', [
......
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