Changes

stable sort? -_-
Line 43: Line 43:  
     local sortKey = stringKey('sort', context, n)
 
     local sortKey = stringKey('sort', context, n)
 
     if sortKey then
 
     if sortKey then
         table.sort(collection, function(a, b) return a[sortKey] < b[sortKey] end)
+
         table.sort(collection, function(a, b)
 +
            if a[sortKey] ~= b[sortKey] then
 +
                return a[sortKey] < b[sortKey]
 +
            else
 +
                return a._id < b._id
 +
            end
 +
        end)
 
     end
 
     end
 
     local i = 1
 
     local i = 1
cssedit, gkautomate
6,942

edits