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