Use mithril "key" trick to accelerate package list view

This commit is contained in:
Steve Purcell 2014-08-20 08:53:06 +01:00
parent bc25d156c8
commit c82f5dd80a
2 changed files with 2 additions and 6 deletions

View file

@ -23,9 +23,6 @@ pre code { /* Match highlight.js styles to bootstrap */
#package-list th, #package-list td.version, #package-list td.recipe {
white-space: nowrap;
}
#package-list tr.filtered {
display: none;
}
#package-list td a:link {
display: block;
}

View file

@ -234,9 +234,8 @@
])
]),
m("tbody",
ctrl.sortedPackages().map(function(p) {
return m("tr", { "class": visible[p.name] ? '' : 'filtered'},
[
ctrl.sortedPackages().filter(function(p) { return visible[p.name]; }).map(function(p) {
return m("tr", { key: p.name }, [
m("td", packageLink(p)),
m("td", packageLink(p, p.description)),
m("td.version", packageLink(p, [p.version, " ", glyphicon('download')])),