You are here

function responsive_preview_library_alter in Responsive Theme Preview 7

Implements hook_library_alter().

Backport a couple of things from jQuery that are required.

File

./responsive_preview.module, line 311
Provides a component that previews the a page in various device dimensions.

Code

function responsive_preview_library_alter(&$libraries, $module) {
  $jquery_version =& drupal_static(__FUNCTION__, NULL);
  if ($module == 'system') {
    $jquery_version = $libraries['jquery']['version'];
  }
  if ($jquery_version && $module == 'responsive_preview') {
    $path = drupal_get_path('module', 'responsive_preview');

    // If the version of jQuery is old, we need to add `on` and `off`.
    if ($jquery_version < '1.7') {
      $libraries['responsive-preview']['js'][$path . '/js/jquery/ducktape.events.js'] = array(
        'group' => JS_LIBRARY,
      );
    }
  }
}