Improved sort, only use lower if attribute is a string.

This commit is contained in:
Martin Edenhofer 2014-11-02 20:45:22 +01:00
parent 99f64668e7
commit 0207cfe0e8

View file

@ -553,8 +553,11 @@ class App.Model extends Spine.Model
return '' if item[ attribute ] is undefined
return '' if item[ attribute ] is null
# return value
item[ attribute ].toLowerCase()
# return value if string
if item[ attribute ].toLowerCase
return item[ attribute ].toLowerCase()
item[ attribute ]
)
@_order: ( collection, attribute ) ->