new version with ajax

This commit is contained in:
rnsrk 2025-01-09 18:27:23 +01:00
parent 27c044f040
commit a0b1c7785e
8 changed files with 415 additions and 128 deletions

View file

@ -28,7 +28,6 @@
temp = queries[i].split('=');
params[temp[0]] = temp[1];
}
return params;
};
@ -54,15 +53,15 @@
});
}
// Update items_per_page links in pager
if (url.indexOf("items_per_page=") == -1) {
// Update items_per_page links in pager
if (url.indexOf("items_per_page=") == -1) {
// append items_per_page
$("a.pager__itemsperpage").each(function( index ) {
var newUrl = url + "&items_per_page=" + $(this).html();
$(this).attr("href", newUrl);
});
}
else {
}
else {
// replace existed items_per_page
var params = parseQueryString(url.split("?")[1]);
var newParams = [];
@ -76,7 +75,7 @@
}
// check for items_per_page query
if (!key.startsWith("items_per_page")) {
if (!key.startsWith("items_per_page")) {
newParams.push(key + "=" + params[key]);
}
}
@ -88,15 +87,15 @@
// Update display mode links in pager
if (url.indexOf("display=") == -1) {
// Update display mode links in pager
if (url.indexOf("display=") == -1) {
// append items_per_page
$("a.pager__display").each(function( index ) {
var newUrl = url + "&display=" + $(this).find(".display-mode").html().toLowerCase();
$(this).attr("href", newUrl);
});
}
else {
}
else {
// replace existed display
var params = parseQueryString(url.split("?")[1]);
var newParams = [];
@ -110,7 +109,7 @@
}
// check for display query
if (!key.startsWith("display")) {
if (!key.startsWith("display")) {
newParams.push(key + "=" + params[key]);
}
}
@ -123,7 +122,7 @@
}
// Replace filter, pager, summary, and facet blocks.
var blocks = {};
$(
@ -191,6 +190,7 @@
var params = Drupal.Views.parseQueryString(href);
// Remove the page if set as submitting the form should always take
// the user to the first page (facets do the same).
console.log("params", params);
delete params.page;
// Include values from the form in the URL.
$.each(exposed_form.serializeArray(), function () {