diff --git a/js/ajax_view.js b/js/ajax_view.js index f906105..f78dc7c 100644 --- a/js/ajax_view.js +++ b/js/ajax_view.js @@ -11,7 +11,10 @@ Drupal.behaviors.ViewsAjaxView = {}; Drupal.behaviors.ViewsAjaxView.attach = function() { if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) { $.each(Drupal.settings.views.ajaxViews, function(i, settings) { - Drupal.views.instances[i] = new Drupal.views.ajaxView(settings); + var ajaxView = new Drupal.views.ajaxView(settings); + // Ensure the ajax handling is kept in a global unique object even if this + // was called multiple times for the same view. + Drupal.views.instances[i] = $.extend({}, Drupal.views.instances[i], ajaxView); }); } }; @@ -73,7 +76,6 @@ Drupal.views.ajaxView.prototype.attachExposedFormAjax = function() { button = button[0]; this.exposedFormAjax = new Drupal.ajax($(button).attr('id'), button, this.element_settings); - $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form).data('exposedFormAjax', this.exposedFormAjax); }; /** @@ -93,7 +95,6 @@ Drupal.views.ajaxView.prototype.attachRefreshViewAjax = function(index, elem) { var self_settings = this.element_settings; self_settings.event = 'RefreshView'; this.refreshViewAjax = new Drupal.ajax(this.$view, elem, self_settings); - $(elem).data('refreshViewAjax', this.refreshViewAjax); }; Drupal.views.ajaxView.prototype.filterNestedViews= function() { @@ -133,7 +134,6 @@ Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function(id, link) { this.element_settings.submit = viewData; this.pagerAjax = new Drupal.ajax(false, $link, this.element_settings); - $link.data('pagerAjax', this.pagerAjax); }; Drupal.ajax.prototype.commands.viewsScrollTop = function (ajax, response, status) {