diff --git a/css/style.css b/css/style.css index fa7d054..a13e664 100644 --- a/css/style.css +++ b/css/style.css @@ -243,3 +243,13 @@ e.g. multipage*/ border: 0 none; margin: 0; } + +/* Views AJAX pagination support */ +.pagination ul > li > a.progress-disabled { + float: left; +} +.pagination ul > li a .throbber { + margin: 0 -0.25em 0 0.5em; + position: relative; + top: 1px; +} diff --git a/includes/theme.inc b/includes/theme.inc index 95137eb..f44e4b9 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -309,9 +309,14 @@ function bootstrap_js_alter(&$js) { // Fix broken Views AJAX pagers. if (module_exists('views') && !empty($js[drupal_get_path('module', 'views') . '/js/ajax_view.js'])) { - $ajax_view = $theme_path . '/js/ajax_view.js'; + // Override core ajax prototype function to append throbber inside links, + // instead of after it (floating issues). + $ajax = $theme_path . '/js/bootstrap_ajax.js'; + $js[$ajax] = drupal_js_defaults($ajax); + $js[$ajax]['group'] = JS_THEME; + // Override views prototype function to bind to Bootstrap pagination. + $ajax_view = $theme_path . '/js/bootstrap_ajax_view.js'; $js[$ajax_view] = drupal_js_defaults($ajax_view); - // Need to fix the group this belongs to so it loads after the views module. $js[$ajax_view]['group'] = JS_THEME; } diff --git a/js/ajax_view.js b/js/ajax_view.js deleted file mode 100644 index ec6b55d..0000000 --- a/js/ajax_view.js +++ /dev/null @@ -1,12 +0,0 @@ -(function ($) { - -/** - * Override Views prototype function so it can recognize Bootstrap AJAX pagers. - * Attach the ajax behavior to each link. - */ -Drupal.views.ajaxView.prototype.attachPagerAjax = function() { - this.$view.find('ul.pager > li > a, th.views-field a, .attachment .views-summary a, .pagination ul li a') - .each(jQuery.proxy(this.attachPagerLinkAjax, this)); -}; - -})(jQuery);