Event list filter: Save scroll position

This commit is contained in:
Raphael Michel
2023-11-24 15:05:05 +01:00
parent 7648be7937
commit 49d4324992
3 changed files with 4 additions and 4 deletions

View File

@@ -52,12 +52,12 @@
{% include "pretixpresale/fragment_week_calendar.html" with show_avail=event.settings.event_list_availability days=subevent_list.days show_names=subevent_list.show_names %}
<div class="visible-xs text-center" aria-hidden="true">
<a href="?{% url_replace request "date" subevent_list.before|date:"o-\WW" %}"
class="btn btn-default">
class="btn btn-default" data-save-scrollpos aria-label="{% blocktrans with week=subevent_list.before|date:subevent_list.week_format %}Show previous week, {{ week }}{% endblocktrans %}">
<span class="fa fa-arrow-left" aria-hidden="true"></span>
{{ subevent_list.before|date:subevent_list.week_format }}
</a>
<a href="?{% url_replace request "date" subevent_list.after|date:"o-\WW" %}"
class="btn btn-default">
class="btn btn-default" data-save-scrollpos aria-label="{% blocktrans with week=subevent_list.after|date:subevent_list.week_format %}Show next week, {{ week }}{% endblocktrans %}">
{{ subevent_list.after|date:subevent_list.week_format }}
<span class="fa fa-arrow-right" aria-hidden="true"></span>
</a>

View File

@@ -5,7 +5,7 @@
{% load getitem %}
{% if filter_form.fields %}
<form class="event-list-filter-form" method="get">
<form class="event-list-filter-form" method="get" data-save-scrollpos>
<input type="hidden" name="filtered" value="1">
{% for f, v in request.GET.items %}
{% if f not in filter_form.fields %}

View File

@@ -379,7 +379,7 @@ $(function () {
});
}
if (sessionStorage) {
$("[data-save-scrollpos]").click(function () {
$("[data-save-scrollpos]").on("click submit", function () {
sessionStorage.setItem('scrollpos', window.scrollY);
});
}