Merge pull request #4133 from diaspora/fix_tags_ordering

Fix tags ordering in chrome
This commit is contained in:
Jonne Haß 2013-05-25 11:55:53 -07:00
commit cae70d8194
3 changed files with 3 additions and 2 deletions

View file

@ -10,6 +10,7 @@
* Don't use Pathname early to circumvent some rare initialization errors [#3816](https://github.com/diaspora/diaspora/issues/3816) * Don't use Pathname early to circumvent some rare initialization errors [#3816](https://github.com/diaspora/diaspora/issues/3816)
* Don't error out in script/server if git is unavailable. * Don't error out in script/server if git is unavailable.
* Fix post preview from tag pages [#4157](https://github.com/diaspora/diaspora/issues/4157) * Fix post preview from tag pages [#4157](https://github.com/diaspora/diaspora/issues/4157)
* Fix tags ordering in chrome [#4133](https://github.com/diaspora/diaspora/issues/4133)
## Features ## Features

View file

@ -3,7 +3,7 @@ app.collections.TagFollowings = Backbone.Collection.extend({
model: app.models.TagFollowing, model: app.models.TagFollowing,
url : "/tag_followings", url : "/tag_followings",
comparator: function(first_tf, second_tf) { comparator: function(first_tf, second_tf) {
return first_tf.get("name") < second_tf.get("name"); return -first_tf.get("name").localeCompare(second_tf.get("name"));
}, },
create : function(model) { create : function(model) {

View file

@ -7,7 +7,7 @@ describe("app.collections.TagFollowings", function(){
it("should compare in reverse order", function() { it("should compare in reverse order", function() {
var a = new app.models.TagFollowing({name: "aaa"}), var a = new app.models.TagFollowing({name: "aaa"}),
b = new app.models.TagFollowing({name: "zzz"}) b = new app.models.TagFollowing({name: "zzz"})
expect(this.collection.comparator(a, b)).toBe(true) expect(this.collection.comparator(a, b)).toBeGreaterThan(0)
}) })
}) })