From a8198c1643464f003161e997d7886c1b3a77ef5e Mon Sep 17 00:00:00 2001 From: Foster Hoff Date: Wed, 18 Jan 2017 13:46:09 -0800 Subject: [PATCH] sort by lowercase --- app/assets/javascripts/app/services/modelManager.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/services/modelManager.js b/app/assets/javascripts/app/services/modelManager.js index 325f9f1ef..7ddf1d3b7 100644 --- a/app/assets/javascripts/app/services/modelManager.js +++ b/app/assets/javascripts/app/services/modelManager.js @@ -117,7 +117,10 @@ class ModelManager { items.forEach(function(item){ if(item.content_type == "Tag") { if(!_.find(this.tags, {uuid: item.uuid})) { - this.tags.splice(_.sortedIndexBy(this.tags, item, 'title'), 0, item); + this.tags.splice(_.sortedIndexBy(this.tags, item, function(item){ + if (item.title) return item.title.toLowerCase(); + else return '' + }), 0, item); } } else if(item.content_type == "Note") { if(!_.find(this.notes, {uuid: item.uuid})) {