Skip to content
Snippets Groups Projects
Commit 8c95cc14 authored by Michael Lee's avatar Michael Lee
Browse files

Merge branch 'views_infinite_scroll'

parents dd3f6405 cf1294e8
No related branches found
No related tags found
No related merge requests found
......@@ -7924,17 +7924,17 @@
},
{
"name": "drupal/views_infinite_scroll",
"version": "1.8.0",
"version": "1.9.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/views_infinite_scroll.git",
"reference": "8.x-1.8"
"reference": "8.x-1.9"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/views_infinite_scroll-8.x-1.8.zip",
"reference": "8.x-1.8",
"shasum": "b9fceb24184792fb81c4e2ff1bf7f18fd8e50674"
"url": "https://ftp.drupal.org/files/projects/views_infinite_scroll-8.x-1.9.zip",
"reference": "8.x-1.9",
"shasum": "875d58d317d48036ed1d9ef538bc8a76bc3dcb5b"
},
"require": {
"drupal/core": "^8.8 || ^9"
......@@ -7942,8 +7942,8 @@
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-1.8",
"datestamp": "1615218916",
"version": "8.x-1.9",
"datestamp": "1632421809",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......
......@@ -8256,18 +8256,18 @@
},
{
"name": "drupal/views_infinite_scroll",
"version": "1.8.0",
"version_normalized": "1.8.0.0",
"version": "1.9.0",
"version_normalized": "1.9.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/views_infinite_scroll.git",
"reference": "8.x-1.8"
"reference": "8.x-1.9"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/views_infinite_scroll-8.x-1.8.zip",
"reference": "8.x-1.8",
"shasum": "b9fceb24184792fb81c4e2ff1bf7f18fd8e50674"
"url": "https://ftp.drupal.org/files/projects/views_infinite_scroll-8.x-1.9.zip",
"reference": "8.x-1.9",
"shasum": "875d58d317d48036ed1d9ef538bc8a76bc3dcb5b"
},
"require": {
"drupal/core": "^8.8 || ^9"
......@@ -8275,8 +8275,8 @@
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-1.8",
"datestamp": "1614959012",
"version": "8.x-1.9",
"datestamp": "1632421809",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......
......@@ -1823,12 +1823,12 @@
'dev_requirement' => false,
),
'drupal/views_infinite_scroll' => array(
'pretty_version' => '1.8.0',
'version' => '1.8.0.0',
'pretty_version' => '1.9.0',
'version' => '1.9.0.0',
'type' => 'drupal-module',
'install_path' => __DIR__ . '/../../web/modules/views_infinite_scroll',
'aliases' => array(),
'reference' => '8.x-1.8',
'reference' => '8.x-1.9',
'dev_requirement' => false,
),
'drupal/views_ui' => array(
......
......@@ -33,6 +33,11 @@
$.fn.infiniteScrollInsertView = function ($newView) {
// Extract the view DOM ID from the view classes.
var matches = /(js-view-dom-id-\w+)/.exec(this.attr('class'));
if (!matches) {
return;
}
var currentViewId = matches[1].replace('js-view-dom-id-', 'views_dom_id:');
// Get the existing ajaxViews object.
......@@ -104,4 +109,19 @@
}
};
/**
* Views AJAX pagination filter.
*
* In case the Entity View Attachment is rendered in a view context,
* the default filter function prevents the required 'Use AJAX' setting
* to work.
*
* @return {Boolean}
* Whether to apply the Views AJAX paginator. VIS requires this setting
* for pagination.
*/
Drupal.views.ajaxView.prototype.filterNestedViews = function () {
return this.$view.hasClass('view-eva') || !this.$view.parents('.view').length;
};
})(jQuery, Drupal, Drupal.debounce);
......@@ -49,7 +49,10 @@ public function onResponse(FilterResponseEvent $event) {
$view = $response->getView();
// Only alter commands if the user has selected our pager and it attempting
// to move beyond page 0.
if ($view->getPager()->getPluginId() !== 'infinite_scroll' || $event->getRequest()->query->get('page') == 0) {
if ($view->getPager()->getPluginId() !== 'infinite_scroll' ||
$view->getCurrentPage() === 0 ||
$view->getPager()->getCurrentPage() === 0
) {
// When the current page is 0 it might be the case that there where no
// additional items in this case we want to still append the empty result.
return;
......
......@@ -7,7 +7,7 @@ core_version_requirement: ^8.8 || ^9
dependencies:
- drupal:views
# Information added by Drupal.org packaging script on 2021-03-05
version: '8.x-1.8'
# Information added by Drupal.org packaging script on 2021-09-23
version: '8.x-1.9'
project: 'views_infinite_scroll'
datestamp: 1614959014
datestamp: 1632421789
......@@ -52,3 +52,12 @@ function views_infinite_scroll_preprocess_views_view(&$vars) {
}
}
}
/**
* Implements hook_preprocess_eva_display_entity_view()
*/
function views_infinite_scroll_preprocess_eva_display_entity_view(&$vars) {
// When the contributed EVA module is used to display the View, apply the
// preprocessing logic of this module.
views_infinite_scroll_preprocess_views_view($vars);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment