diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-05-07 17:32:02 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-05-07 17:33:15 +0200 |
commit | a5427163ced9f99044813058ddf62548debc673c (patch) | |
tree | 7bbd7efd42d497e1f6aff542d2c9284353620c3d /lib | |
parent | 012169b095c2cb115cbf77707af4304a6e4a1f61 (diff) |
app: Use AJAX, not HTTP Refresh for auto-reload2.0.2
Diffstat (limited to 'lib')
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 80e050d..f95330f 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -773,6 +773,10 @@ sub handle_request { } } + if ( $self->param('ajax') ) { + delete $self->stash->{layout}; + } + if ( $template eq 'json' ) { $self->res->headers->access_control_allow_origin(q{*}); my $json = $self->render_to_string( @@ -811,7 +815,6 @@ sub handle_request { ); } elsif ( my $train = $self->param('train') ) { - delete $self->stash->{layout}; my ($departure) = @departures; @@ -853,7 +856,7 @@ sub handle_request { departures => \@departures, version => $dbf_version, title => "Abfahrtsmonitor $station_name", - refresh_interval => 120, + refresh_interval => $template eq 'app' ? 0 : 120, hide_opts => $hide_opts, hide_low_delay => $hide_low_delay, show_realtime => $show_realtime, |