Skip to content

Commit

Permalink
imp: Reset the scroll when doing a "day" action in the news
Browse files Browse the repository at this point in the history
This was disturbing because the context of the page was lost after
marking a day as read for instance (for instance, the middle of the list
of links of the next day would appear instead of its beginning).
  • Loading branch information
marienfressinaud committed May 27, 2024
1 parent afdb1d9 commit be6111b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/views/news/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<nav class="popup__container popup__container--left" role="menu">
<div class="popup__title"><?= _('Actions on the day') ?></div>

<form data-turbo-preserve-scroll method="post" action="<?= url('mark collection as read', ['id' => $news->id]) ?>" role="menuitem">
<form method="post" action="<?= url('mark collection as read', ['id' => $news->id]) ?>" role="menuitem">
<input type="hidden" name="csrf" value="<?= $csrf_token ?>" />
<input type="hidden" name="from" value="<?= url('news') ?>" />
<input type="hidden" name="date" value="<?= $date_group->date->format('Y-m-d') ?>" />
Expand All @@ -57,7 +57,7 @@
</button>
</form>

<form data-turbo-preserve-scroll method="post" action="<?= url('read collection later', ['id' => $news->id]) ?>" role="menuitem">
<form method="post" action="<?= url('read collection later', ['id' => $news->id]) ?>" role="menuitem">
<input type="hidden" name="csrf" value="<?= $csrf_token ?>" />
<input type="hidden" name="from" value="<?= url('news') ?>" />
<input type="hidden" name="date" value="<?= $date_group->date->format('Y-m-d') ?>" />
Expand All @@ -71,7 +71,6 @@
<div class="popup__separator"></div>

<form
data-turbo-preserve-scroll
method="post"
action="<?= url('never read collection', ['id' => $news->id]) ?>"
data-turbo-confirm="<?= _('You’ll remove all the news links, this action cannot be canceled. Are you sure?') ?>"
Expand Down

0 comments on commit be6111b

Please sign in to comment.