Browse Source

addCategories: sort repository list - newest first

master
parent
commit
3860882d87
  1. 3
      package.json
  2. 6
      src/addCategories.js

3
package.json

@ -26,7 +26,8 @@
"openstreetmap-tag-translations": "https://github.com/plepe/openstreetmap-tag-translations",
"overpass-layer": "https://github.com/plepe/overpass-layer",
"query-string": "^5.0.0",
"sheet-router": "^4.2.3"
"sheet-router": "^4.2.3",
"weight-sort": "^1.3.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",

6
src/addCategories.js

@ -1,5 +1,6 @@
var OpenStreetBrowserLoader = require('./OpenStreetBrowserLoader')
require('./addCategories.css')
var weightSort = require('weight-sort')
var content
@ -53,7 +54,10 @@ function addCategoriesShow (repo) {
h.innerHTML = lang('more_categories')
content.appendChild(h)
list = repoData
list = weightSort(repoData, {
key: 'timestamp',
reverse: true
})
}
var ul = document.createElement('ul')

Loading…
Cancel
Save