- return ret.sort(function(a, b){
- return (a.title > b.title) ? -1 : 1;
- });
+ return ret.sort(function(a,b) {
+ var titleA = a.title && a.title.toUpperCase();
+ var titleB = b.title && b.title.toUpperCase();
+ return (titleA < titleB) ? -1 : (titleA > titleB) ? 1 : 0;
+ });