Unified · Split
| @@ -69,6 +69,8 @@ · 68 unmodified lines | ||
| 69 | 69 | docs = @settings.getDocs() |
| 70 | 70 | for doc in @DOCS |
| 71 | 71 | (if docs.indexOf(doc.slug) >= 0 then @docs else @disabledDocs).add(doc) |
| 72 | + @docs.sort() | |
| 73 | + @disabledDocs.sort() | |
| 72 | 74 | @docs.load @start.bind(@), @onBootError.bind(@), readCache: true, writeCache: true |
| 73 | 75 | delete @DOCS |
| 74 | 76 | return |
| @@ -1,6 +1,12 @@ | ||
| 1 | 1 | class app.collections.Docs extends app.Collection |
| 2 | 2 | @model: 'Doc' |
| 3 | 3 | |
| 4 | + sort: -> | |
| 5 | + @models.sort (a, b) -> | |
| 6 | + a = a.name.toLowerCase() | |
| 7 | + b = b.name.toLowerCase() | |
| 8 | + if a < b then -1 else if a > b then 1 else 0 | |
| 9 | + | |
| 4 | 10 | # Load models concurrently. |
| 5 | 11 | # It's not pretty but I didn't want to import a promise library only for this. |
| 6 | 12 | CONCURRENCY = 3 |