From bcf1bb3187b6991987036a04637764f3b2229617 Mon Sep 17 00:00:00 2001
From: Caio SBA <caiosba@gmail.com>
Date: Sun, 30 Dec 2012 23:57:02 -0200
Subject: [PATCH] The Ajax pager handler must be attached by the closest parent, not for the outer most

---
 js/ajax_view.js |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/js/ajax_view.js b/js/ajax_view.js
index 2a4012f..c108d05 100644
--- a/js/ajax_view.js
+++ b/js/ajax_view.js
@@ -62,9 +62,6 @@ Drupal.views.ajaxView = function(settings) {
 
   // Add the ajax to pagers.
   this.$view
-    // Don't attach to nested views. Doing so would attach multiple behaviors
-    // to a given element.
-    .filter(jQuery.proxy(this.filterNestedViews, this))
     .once(jQuery.proxy(this.attachPagerAjax, this));
 };
 
@@ -75,12 +72,6 @@ Drupal.views.ajaxView.prototype.attachExposedFormAjax = function() {
   this.exposedFormAjax = new Drupal.ajax($(button).attr('id'), button, this.element_settings);
 };
 
-Drupal.views.ajaxView.prototype.filterNestedViews= function() {
-  // If there is at least one parent with a view class, this view
-  // is nested (e.g., an attachment). Bail.
-  return !this.$view.parents('.view').size();
-};
-
 /**
  * Attach the ajax behavior to each link.
  */
@@ -94,6 +85,8 @@ Drupal.views.ajaxView.prototype.attachPagerAjax = function() {
  */
 Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function(id, link) {
   var $link = $(link);
+  // Don't attach to pagers inside nested views.
+  if (!$link.closest('.view').is(this.$view)) return;
   var viewData = {};
   var href = $link.attr('href');
   // Construct an object using the settings defaults and then overriding
-- 
1.7.2.5

From 3b70f34d4d8956fbc88b1756d908e04c7ceec418 Mon Sep 17 00:00:00 2001
From: James Andres <james.andres@gmail.com>
Date: Thu, 7 Feb 2013 16:11:06 -0500
Subject: [PATCH] Correcting ajax_view.js patch, the jQuery.is() function does
 not accept object arguments until jQuery version 1.6.

---
 js/ajax_view.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/ajax_view.js b/js/ajax_view.js
index c108d05..9cd3248 100644
--- a/js/ajax_view.js
+++ b/js/ajax_view.js
@@ -86,7 +86,7 @@ Drupal.views.ajaxView.prototype.attachPagerAjax = function() {
 Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function(id, link) {
   var $link = $(link);
   // Don't attach to pagers inside nested views.
-  if (!$link.closest('.view').is(this.$view)) return;
+  if ($link.closest('.view')[0] != this.$view[0]) return;
   var viewData = {};
   var href = $link.attr('href');
   // Construct an object using the settings defaults and then overriding
-- 
1.7.11.3

