You are here

function acquia_lift_library_alter in Acquia Lift Connector 7.2

Same name and namespace in other branches
  1. 7 acquia_lift.module \acquia_lift_library_alter()

Implements hook_library_alter().

Backport a couple of things from jQuery that are required.

File

./acquia_lift.module, line 1728
acquia_lift.module Provides Acquia Lift-specific personalization functionality.

Code

function acquia_lift_library_alter(&$libraries, $module) {
  $jquery_version =& drupal_static(__FUNCTION__, NULL);
  if ($module == 'system') {
    $jquery_version = $libraries['jquery']['version'];
  }
  if ($jquery_version && $module == 'acquia_lift') {

    // If the version of jQuery is old, we need to add `on` and `off`.
    if (version_compare($jquery_version, '1.7', '<') && isset($libraries['acquia_lift.page']['version'])) {
      $vaui_path = drupal_get_path('module', 'visitor_actions_ui');
      $libraries['acquia_lift.page']['js'][$vaui_path . '/js/jquery/ducktape.events.js'] = array(
        'group' => JS_LIBRARY,
      );
    }
  }

  // If we are using the unified navbar, then fix the behavior with overlay module.
  if ($module === 'overlay' && _acquia_lift_using_unified_navbar() && !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', 'acquia_lift') . '/css/navbar/navbar-overlay-child.css'] = array();
  }
}