@@ -121,6 +121,14 @@ function kalatheme_links__system_main_menu($variables) {
121121 if (!empty ($ link ['#below ' ])) {
122122 $ class [] = 'dropdown ' ;
123123 $ class [] = 'clearfix ' ;
124+ // print a toggle.
125+ $ link ['#options ' ]['attributes ' ]['role ' ] = array ("button " );
126+ $ link ['#options ' ]['attributes ' ]['class ' ] += array ("dropdown-toggle " );
127+ $ link ['#options ' ]['attributes ' ]['id ' ] = "main-menu-dropdown- " . $ i ;
128+ $ link ['#options ' ]['attributes ' ]['data-toggle ' ] = array ("dropdown " );
129+ $ link ['#options ' ]['attributes ' ]['aria-haspopup ' ] = array ("true " );
130+ $ link ['#options ' ]['html ' ] = true ;
131+ $ link ['#title ' ] .= '<span class="caret" aria-hidden="true"></span> ' ;
124132 }
125133 $ output .= '<li ' . drupal_attributes (array ('class ' => $ class , 'role ' =>'presentation ' )) . '> ' ;
126134
@@ -141,12 +149,11 @@ function kalatheme_links__system_main_menu($variables) {
141149 }
142150
143151 $ clearfix = '' ;
144- // If link has child items, print a toggle and dropdown menu.
152+ // If link has child items, print a dropdown menu.
145153 if (!empty ($ link ['#below ' ])) {
146154 $ dropdown_id = 'main-menu-dropdown- ' . $ i ;
147- $ output .= '<a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown" id=" ' . $ dropdown_id . '" aria-haspopup="true"> ' ;
148155 //Add in text to be available for AT
149- $ output .= '<span class="element-invisible">Toggle submenu for ' . $ link ['#title ' ] . '</span><span class="caret" aria-hidden="true"> </span></a> ' ;
156+ $ output .= '<span class="element-invisible">Toggle submenu for ' . strip_tags ( $ link ['#title ' ]) . '</span></a> ' ;
150157 $ output .= theme ('links__system_main_menu ' , array (
151158 'links ' => $ link ['#below ' ],
152159 'attributes ' => array (
0 commit comments