diff --git a/css/wetkit_menu.css b/css/wetkit_menu.css index 326d6aa..73aaadc 100644 --- a/css/wetkit_menu.css +++ b/css/wetkit_menu.css @@ -1,15 +1,97 @@ -/** @file Custom SCSS for the WetKit Menu module. */ -.mb-menu li h4 a { text-decoration: none !important; } -.mb-menu li h4 a:hover { text-decoration: underline !important; } -.mb-menu ul li.top-level a { text-decoration: none !important; } -.mb-menu ul li.top-level a:hover { text-decoration: underline !important; } +/** + * @file + * Custom SCSS for the WetKit Menu module. + */ +.mb-menu li h4 a { + text-decoration: none !important; } + .mb-menu li h4 a:hover { + text-decoration: underline !important; } +.mb-menu ul li.top-level a { + text-decoration: none !important; } + .mb-menu ul li.top-level a:hover { + text-decoration: underline !important; } -.pane-menu-tree .top-level-alt { margin: 0 0 3px; } -.pane-menu-tree .top-level-alt a { background: #0b3048; padding-top: 8px; padding-bottom: 8px; font-size: 1.1em; color: white !important; font-weight: bold; } +.pane-menu-tree .top-level-alt { + margin: 0 0 3px; } + .pane-menu-tree .top-level-alt a { + background: #0b3048; + padding-top: 8px; + padding-bottom: 8px; + font-size: 1.1em; + color: white !important; + font-weight: bold; } -#wb-sec .expanded .list-group .list-group .list-group-item { background: #F2F2F2 !important; color: #555 !important; padding-left: 2.8em !important; } -#wb-sec .expanded .list-group .list-group .list-group .list-group-item { background: #e6e6e6 !important; color: #555 !important; padding-left: 3.8em !important; } -#wb-sec .list-group .list-group a.list-group-item.wb-navcurr { background: #146094 !important; color: #fff !important; } -#wb-sec .list-group .list-group a.list-group-item[href]:focus, #wb-sec .list-group .list-group a.list-group-item[href]:hover { background: #146094 !important; color: #fff !important; } -#wb-sec .list-group .list-group .list-group a.list-group-item.wb-navcurr { background: #146094 !important; color: #fff !important; } -#wb-sec .list-group .list-group .list-group a.list-group-item[href]:focus, #wb-sec .list-group .list-group .list-group a.list-group-item[href]:hover { background: #146094 !important; color: #fff !important; } +#wb-sec .expanded .list-group .list-group .list-group-item { + background: #F2F2F2 !important; + color: #555 !important; + padding-left: 2.8em !important; } +#wb-sec .expanded .list-group .list-group .list-group .list-group-item { + background: #e6e6e6 !important; + color: #555 !important; + padding-left: 3.8em !important; } +#wb-sec .list-group .list-group a.list-group-item.wb-navcurr { + background: #146094 !important; + color: #fff !important; } +#wb-sec .list-group .list-group a.list-group-item[href]:focus, #wb-sec .list-group .list-group a.list-group-item[href]:hover { + background: #146094 !important; + color: #fff !important; } +#wb-sec .list-group .list-group .list-group a.list-group-item.wb-navcurr { + background: #146094 !important; + color: #fff !important; } +#wb-sec .list-group .list-group .list-group a.list-group-item[href]:focus, #wb-sec .list-group .list-group .list-group a.list-group-item[href]:hover { + background: #146094 !important; + color: #fff !important; } + +.sidebar-nav-right { + margin-bottom: 30px; } + .sidebar-nav-right .nav > li > a { + padding: 0; } + .sidebar-nav-right .list-group { + margin: 0; + border-radius: 0; } + .sidebar-nav-right .list-group .list-group-item.active a:hover { + background: #0A466F; } + .sidebar-nav-right .list-group .list-group-item.active .list-group a:hover { + background: #e6e6e6; } + .sidebar-nav-right .list-group .list-group-item { + padding: 0; + background: #eee; + border-radius: 0; + border-left: 0; + border-right: 0; } + .sidebar-nav-right .list-group .list-group-item .list-group-item { + border-left: 0; + border-right: 0; } + .sidebar-nav-right .list-group .list-group-item a { + padding: 10px 15px 10px 25px; + display: block; + border-radius: 0; } + .sidebar-nav-right .list-group .list-group-item a:hover { + background: #e6e6e6; } + .sidebar-nav-right .list-group .list-group-item.active { + padding: 0; + background: #146094; } + .sidebar-nav-right .list-group .list-group-item.active a { + color: #fff; } + .sidebar-nav-right .list-group .list-group .list-group-item { + padding: 0; + background: #ddd; } + .sidebar-nav-right .list-group .list-group .list-group-item a { + padding: 10px 15px 10px 40px; } + .sidebar-nav-right .list-group .list-group .list-group .list-group-item a { + padding: 10px 15px 10px 55px; } + .sidebar-nav-right .list-group .list-group .list-group .list-group .list-group-item a { + padding: 10px 15px 10px 70px; } + .sidebar-nav-right .list-group-item.active { + background: #146094; + border: none; } + .sidebar-nav-right .list-group-item.active a { + color: #fff; } + .sidebar-nav-right .list-group-item.active a:hover { + background: #0A466F; } + .sidebar-nav-right .list-group-item.active .list-group a { + color: #295376; } + .sidebar-nav-right .menu.nav > li { + padding: 0; } + .sidebar-nav-right .menu.nav > li > { + padding: 10px 15px; } diff --git a/sass/wetkit_menu.scss b/sass/wetkit_menu.scss index 79b58c6..db19a09 100644 --- a/sass/wetkit_menu.scss +++ b/sass/wetkit_menu.scss @@ -96,3 +96,54 @@ } } } + +.sidebar-nav-right { margin-bottom:30px; + .nav>li>a { padding:0; } + .list-group { margin:0; border-radius: 0; + .list-group-item.active { + a { + &:hover { background:#0A466F; } + } + .list-group { + a { + &:hover { background:#e6e6e6;} + } + } + } + .list-group-item { padding:0; background:#eee; border-radius: 0; border-left:0; border-right:0; + .list-group-item { border-left:0; border-right:0; } + a { padding:10px 15px 10px 25px; display: block; border-radius: 0; + &:hover { background:#e6e6e6; } + } + &.active { padding:0; background:#146094; + a { color:#fff; } + } + } + .list-group { + .list-group-item { padding:0; background:#ddd; + a { padding:10px 15px 10px 40px; } + } + .list-group { + .list-group-item { + a { padding:10px 15px 10px 55px; } + } + .list-group { + .list-group-item { + a { padding:10px 15px 10px 70px; } + } + } + } + } + } + .list-group-item.active { background:#146094; border:none; + a { color:#fff; + &:hover { background:#0A466F; } + } + .list-group { + a { color:#295376; } + } + } + .menu.nav>li { padding:0; + &> { padding:10px 15px; } + } +} diff --git a/theme/menu.theme.inc b/theme/menu.theme.inc index c830d4a..ee7cd23 100644 --- a/theme/menu.theme.inc +++ b/theme/menu.theme.inc @@ -421,17 +421,27 @@ function wetkit_menu_menu_link_menu_block_section($variables) { * @param array $variables * An array of variables to pass to the theme template. */ + function wetkit_menu_menu_link_menu_block_sidebar_right($variables) { + $element = $variables['element']; $sub_menu = ''; - if (isset($element['#below']) && is_array($element['#below'])) { - $sub_menu = drupal_render($element['#below']); + if ($element['#below']) { + unset($element['#below']['#theme_wrappers']); + $sub_menu = ''; } $output = ''; - $output .= '' . l($element['#title'], $element['#href'], $element['#localized_options']) . $sub_menu . "\n"; + $element['#attributes']['class'][] = 'list-group-item'; + + $output .= '' . l($element['#title'], $element['#href'], $element['#localized_options']) . $sub_menu . "\n"; + //fix menu when only one children item exist (lines 379-381) + if ($element['#attributes']['class'][0] == 'first' && $element['#attributes']['class'][1] == 'last') { + $output .= ''; + } return $output; + } /** diff --git a/wetkit_menu.module b/wetkit_menu.module index 27b9c82..1517e6c 100644 --- a/wetkit_menu.module +++ b/wetkit_menu.module @@ -41,7 +41,12 @@ function wetkit_menu_preprocess_panels_pane(&$variables) { $variables['theme_hook_suggestions'][] = 'wetkit_menu_panels_pane'; } } + if ($variables['content']['#config']['theme'] == 'menu_link__menu_block__wxt_sidebar_right') { + $variables['theme_hook_suggestions'][] = 'wetkit_menu_panels_pane_sidebar_right'; + } } + + } /** @@ -120,7 +125,7 @@ function wetkit_menu_theme($existing, $type, $theme, $path) { 'wetkit_menu_panels_pane_sidebar_right' => array( 'render element' => 'element', 'path' => drupal_get_path('module', 'wetkit_menu') . '/templates/panes', - 'template' => 'megamenu_sidebar', + 'template' => 'sidebar_nav_right', ), ); } @@ -177,6 +182,15 @@ function wetkit_menu_theme_registry_alter(&$theme_registry) { $theme_registry['menu_link__menu_block__wxt_group_list']['function'] = 'wetkit_menu_menu_link_menu_block_group_list'; $theme_registry['menu_link__menu_block__wxt_group_list']['type'] = 'theme_engine'; $theme_registry['menu_link__menu_block__wxt_group_list']['final'] = TRUE; + + + $theme_registry['menu_link__menu_block__wxt_sidebar_right']['base hook'] = 'menu_link'; + $theme_registry['menu_link__menu_block__wxt_sidebar_right']['render element'] = 'element'; + $theme_registry['menu_link__menu_block__wxt_sidebar_right']['theme path'] = drupal_get_path('module', 'wetkit_menu'); + $theme_registry['menu_link__menu_block__wxt_sidebar_right']['file'] = drupal_get_path('module', 'wetkit_menu') . '/theme/menu.theme.inc'; + $theme_registry['menu_link__menu_block__wxt_sidebar_right']['function'] = 'wetkit_menu_menu_link_menu_block_sidebar_right'; + $theme_registry['menu_link__menu_block__wxt_sidebar_right']['type'] = 'theme_engine'; + $theme_registry['menu_link__menu_block__wxt_sidebar_right']['final'] = TRUE; } }