Differentiate sortOrder for repos without lastBuildFinishedAt

All of the repos without lastBuildFinishedAt had the same value for
sortOrder, which could result in 'jumps' on the list when loading new
data from the API.
This commit is contained in:
Piotr Sarnacki 2012-08-01 23:29:38 +02:00
parent de4721abfc
commit 39466a233f
2 changed files with 6 additions and 2 deletions

View File

@ -42,7 +42,11 @@ require 'travis/model'
).property('data.last_build_duration', 'lastBuildStartedAt', 'lastBuildFinishedAt')
sortOrder: (->
- new Date(@get('lastBuildFinishedAt') || '9999').getTime() # cuz sortAscending seems buggy when set to false
# cuz sortAscending seems buggy when set to false
if lastBuildFinishedAt = @get('lastBuildFinishedAt')
- new Date(lastBuildFinishedAt).getTime()
else
- new Date('9999').getTime() + parseInt(@get('id'))
).property('lastBuildFinishedAt')
stats: (->

File diff suppressed because one or more lines are too long