1
0
mirror of https://github.com/moparisthebest/mail synced 2025-02-07 02:20:14 -05:00

added sorting by keys in lawnchair dao

This commit is contained in:
Tankred Hase 2013-06-03 22:20:20 +02:00
parent 1071d89ee9
commit 1266142ad7

View File

@ -71,6 +71,13 @@ app.dao.LawnchairDAO = function(Lawnchair) {
}
}
// sort keys
matchingKeys.sort(function(a, b) {
if (a < b) return -1;
if (b < a) return 1;
return 0;
});
// if num is null, list all items
num = (num !== null) ? num : matchingKeys.length;