Problem/Motivation
Drupal.views.ajaxView is not initializing pagers in nested views. The part here:
// Add the ajax to pagers.
this.$view
// Don't attach to nested views. Doing so would attach multiple behaviors
// to a given element.
.filter($.proxy(this.filterNestedViews, this))
.once('ajax-pager').each($.proxy(this.attachPagerAjax, this));
checks if view is inside another view. As a result pager links in embedded views are initialized in the context of parent. This makes it impossible to perform ajax operations in context of the child view (see this Views Infinite Scroll issue).
Proposed resolution
Initialize ajax views in order determined by their nesting level. The innermost view should go first and mark its elements with .once
so they aren't processed again when parent view is initialized.
Remaining tasks
Write patch- Review
- Write tests
User interface changes
None
API changes
None
Data model changes
None