browser: fallback to order browser columns by name
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 17 Dec 2010 20:23:48 +0000 (21:23 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 17 Dec 2010 20:24:33 +0000 (21:24 +0100)
browser.plp

index 9f8adf7..fa317a8 100644 (file)
@@ -123,6 +123,15 @@ if ($usage) { # first() does not work inside given >:(
                $canihas->{$b}->{-total} <=> $canihas->{$a}->{-total}
        } @browsers;
 }
+else {
+       # order browser columns by name grouped by engine
+       @browsers = sort {
+               $caniuse->{agents}->{$b}->{prefix} cmp
+               $caniuse->{agents}->{$a}->{prefix}
+                       ||
+               $a cmp $b
+       } @browsers;
+}
 :>.
 </p>