From e1a5b4ed5234607ad9d14983bd3773473fb537a0 Mon Sep 17 00:00:00 2001 From: vieron Date: Thu, 13 Jun 2013 12:01:47 +0200 Subject: [PATCH] gridster/fix: using comparators in sort methods. Sort method by default orders alphabetically, but we are sorting numbers and this means that: 40 < 6. And we not expect this result. --- src/jquery.gridster.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index 3296efbfd..53d10a028 100644 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -1384,7 +1384,9 @@ return true; //break } - upper_rows[tcol].sort(); + upper_rows[tcol].sort(function(a, b) { + return a - b; + }); }); if (!result) { return false; } @@ -1439,7 +1441,9 @@ return true; //break } - upper_rows[tcol].sort(); + upper_rows[tcol].sort(function(a, b) { + return a - b; + }); }); if (!result) { return false; }