browser: disable column search if no queryselector
[sheet.git] / browser.plp
index ef260e118401dd5b81649c397d4b7646801348fe..f6de5958b3ef14a86799fb9785bebdbb908eddf5 100644 (file)
@@ -107,7 +107,7 @@ $canihas ||= {
 my $scorediv = (max(map { ref $_ eq 'HASH' && sum(values %$_) } values %$canihas) // 1) / 100;
 
 print '<table class="mapped">';
-print '<col>' x 3;
+print '<col span="3">';  # should match first thead row
 printf '<colgroup span="%d">', scalar @{ $versions{$_} } for @browsers;
 print "\n";
 
@@ -116,8 +116,11 @@ my $header = join('',
        '<th colspan="3">feature',
        (map {
                my $name = $caniuse->{agents}->{$_}->{browser};
-               sprintf('<th colspan="%d" title="%s">%s',
+               sprintf('<th colspan="%d" class="%s" title="%s">%s',
                        scalar @{ $versions{$_} },
+                       join(' ', map {"b-a-$_"} grep {$_}
+                               $_, @{ $caniuse->{agents}->{$_} }{'prefix', 'type'},
+                       ),
                        join(' ',
                                sprintf('%.1f%%', sum(values %{ $canihas->{$_} })),
                                $name,
@@ -189,6 +192,7 @@ sub saytitlecol {
 
        for ($row->{categories}) {
                my $cell = $_ ? lc $_->[0] : '-';
+               $cell =~ s/ api$//;  # trim unessential fluff in 'js api'
                printf '<th title="%s">%s', join(' + ', @$_), $cell;
        }