diff options
author | Clark Laughlin <clark.laughlin@linaro.org> | 2015-10-27 12:43:46 -0400 |
---|---|---|
committer | Clark Laughlin <clark.laughlin@linaro.org> | 2015-10-27 12:43:46 -0400 |
commit | 262e3277db30a61531ed9e452d6074a3b4b4abe3 (patch) | |
tree | 76beb425d38d2f63d3af04b1b4b411df1694455d /registry-browser | |
parent | 7818aa472faf8fbd1227671f35a7ca187019059d (diff) |
index.html: fix tag ordering so latest is always first
Diffstat (limited to 'registry-browser')
-rw-r--r-- | registry-browser/static/index.html | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/registry-browser/static/index.html b/registry-browser/static/index.html index e0c3a13..0ce7edf 100644 --- a/registry-browser/static/index.html +++ b/registry-browser/static/index.html @@ -93,7 +93,15 @@ $(function() { return; $.each(items, function(i, e) { - e['formatted-tags'] = '<li>' + e['tags'].join('</li><li>') + '</li>'; + // force 'latest' to be the first tag displayed + sorted_tags = e['tags']; + latest_idx = sorted_tags.indexOf('latest'); + if(latest_idx > 0) { + sorted_tags.splice(latest_idx, 1); + sorted_tags.unshift('latest'); + } + + e['formatted-tags'] = '<li>' + sorted_tags.join('</li><li>') + '</li>'; }); options = { |