function ultimenu_preprocess_html in Ultimenu 8.2
Implements hook_preprocess_html().
File
- ./
ultimenu.module, line 121 - Build Ultimenu blocks based on menu, and their regions on enabled menu items.
Code
function ultimenu_preprocess_html(&$variables) {
if (_ultimenu_is_applicable()) {
$variables['attributes']['class'][] = 'is-ultimenu-canvas';
// If off-canvas is enabled for both mobile and desktop, add `active`
// class, else it means menu item link is hoverable for desktop.
$active = ultimenu()
->getSetting('goodies.off-canvas-all') ? 'active' : 'hover';
$variables['attributes']['class'][] = 'is-ultimenu-canvas--' . $active;
}
}