From 8abf82949f12ea62fd04ccd0357d4d7858f28c4d Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 15 Oct 2020 21:39:24 +0200 Subject: fix forward button when navigating back to train details --- lib/DBInfoscreen/Controller/Stationboard.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 2bf2bcb..609eefd 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -648,6 +648,10 @@ sub train_details { my $train_no = $self->stash('train'); my $station = $self->stash('station'); + if ( $self->param('ajax') ) { + delete $self->stash->{layout}; + } + my %opt = ( cache_hafas => $self->app->cache_hafas, cache_iris_main => $self->app->cache_iris_main, @@ -739,9 +743,11 @@ sub train_details { $self->stash( title => $data->{station_name} // $self->stash('station') ); $self->stash( hide_opts => 1 ); - $self->render_train( $result, $result_info, + $self->render_train( + $result, $result_info, $data->{station_name} // $self->stash('station'), - 'train_details' ); + $self->param('ajax') ? '_train_details' : 'train_details' + ); } sub handle_result { -- cgit v1.2.3