diff options
author | Yorhel <git@yorhel.nl> | 2020-10-23 11:29:17 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2020-10-23 11:29:19 +0200 |
commit | 9279d0396ffe48897874571a5331f26e1a7d1ee2 (patch) | |
tree | 214394c7595f2fbdf8afa084e6f86ef6aa617079 /lib | |
parent | a41ba6e59347dea2cc8d33ab11783ecda59232eb (diff) |
Fix searchtabs taking over the query when switching tabs
Fixes https://vndb.org/t2520.505
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNWeb/HTML.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VNWeb/HTML.pm b/lib/VNWeb/HTML.pm index 3cc13494..5c0fa3e0 100644 --- a/lib/VNWeb/HTML.pm +++ b/lib/VNWeb/HTML.pm @@ -468,7 +468,7 @@ sub _scripts_ { lit_(JSON::XS->new->canonical->encode(tuwf->req->{pagevars}) =~ s{</}{<\\/}rg =~ s/<!--/<\\u0021--/rg); } if keys tuwf->req->{pagevars}->%*; script_ type => 'application/javascript', src => config->{url_static}.'/f/elm.js?'.config->{version}, '' if tuwf->req->{pagevars}{elm}; - script_ type => 'application/javascript', src => config->{url_static}.'/f/plain.js?'.config->{version}, '' if $o->{js} || tuwf->req->{pagevars}{elm}; + script_ type => 'application/javascript', src => config->{url_static}.'/f/plain.js?'.config->{version}, '' if tuwf->req->{js} || tuwf->req->{pagevars}{elm}; } @@ -490,6 +490,7 @@ sub framework_ { my $cont = pop; my %o = @_; tuwf->req->{pagevars} = { $o{pagevars}->%* } if $o{pagevars}; + tuwf->req->{js} ||= $o{js}; html_ lang => 'en', sub { head_ sub { _head_ \%o }; @@ -787,6 +788,7 @@ sub sortable_ { sub searchbox_ { my($sel, $value) = @_; + tuwf->req->{js} = 1; fieldset_ class => 'search', sub { p_ id => 'searchtabs', sub { a_ href => '/v/all', $sel eq 'v' ? (class => 'sel') : (), 'Visual novels'; |