function navbar_library_alter in Navbar 7
Implements hook_library_alter().
File
- ./
navbar.module, line 784 - Administration navbar for quick access to top level administration items.
Code
function navbar_library_alter(&$libraries, $module) {
$jquery_version =& drupal_static(__FUNCTION__, NULL);
if ($module == 'system') {
$jquery_version = $libraries['jquery']['version'];
}
if ($jquery_version && $module == 'navbar') {
$path = drupal_get_path('module', 'navbar');
// If the version of jQuery is old, we need to add `on` and `off`.
if ($jquery_version < '1.7') {
$libraries['navbar']['js'][$path . '/js/jquery/ducktape.events.js'] = array(
'group' => JS_LIBRARY,
);
}
}
if ($module === 'overlay' && !empty($libraries)) {
// Unset the child CSS file from Overlay and add our own.
if (!empty($libraries['child']['css'])) {
unset($libraries['child']['css']['modules/overlay/overlay-child.css']);
}
$libraries['child']['css'][drupal_get_path('module', 'navbar') . '/css/navbar-overlay-child.css'] = array();
}
}