Commit 959de966 authored by Remon's avatar Remon

Issue #858142 by Remon: Autopager jquery plugin in not loaded.

parent 6a8a37b3
...@@ -85,16 +85,18 @@ function theme_views_infinite_scroll_pager($variables) { ...@@ -85,16 +85,18 @@ function theme_views_infinite_scroll_pager($variables) {
); );
drupal_add_css(drupal_get_path('module', 'views_infinite_scroll') . '/css/views_infinite_scroll.css'); drupal_add_css(drupal_get_path('module', 'views_infinite_scroll') . '/css/views_infinite_scroll.css');
drupal_add_js($settings, array('type' => 'setting', 'scope' => JS_DEFAULT)); drupal_add_js($settings, array('type' => 'setting', 'scope' => JS_DEFAULT));
$autopager_path = '';
if (module_exists('libraries')) { // Add Autopager jQuery plugin
$autopager_path = libraries_get_path('autopager'); // If libraries module is installed, check for the plugin in libraries dir.
if (module_exists('libraries') && file_exists(libraries_get_path('autopager') .'/jquery.autopager-1.0.0.js')) {
drupal_add_js(libraries_get_path('autopager') .'/jquery.autopager-1.0.0.js');
} }
// else, load it from views_infinite_scroll/js dir.
else { else {
$autopager_path = drupal_get_path('module', 'views_infinite_scroll') . '/js'; $autopager_module_path = drupal_get_path('module', 'views_infinite_scroll') . '/js/jquery.autopager-1.0.0.js';
drupal_add_js($autopager_module_path);
} }
drupal_add_js($autopager_path . '/jquery.autopager-1.0.0.js');
drupal_add_js(drupal_get_path('module', 'views_infinite_scroll') . '/js/views_infinite_scroll.js'); drupal_add_js(drupal_get_path('module', 'views_infinite_scroll') . '/js/views_infinite_scroll.js');
return theme('item_list', array('items' => $items, 'title' => NULL, 'type' => 'ul', 'attributes' => array('class' => array($PAGER_CLASS)))); return theme('item_list', array('items' => $items, 'title' => NULL, 'type' => 'ul', 'attributes' => array('class' => array($PAGER_CLASS))));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment