Backport a JSON_delta fix that would cause deletions to go in the wrong order, causin...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Jan 2018 11:20:15 +0000 (12:20 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Jan 2018 11:20:15 +0000 (12:20 +0100)
www/js/json_delta.js

index dad457b..91b17e1 100644 (file)
@@ -76,7 +76,7 @@ JSON_delta = {
        if (diff.length == 0) {return [[], diff]}
        diff.sort(function (a,b) {return b.length-a.length});
        for (idx in diff) {
-           if (diff[idx] > 1) {break}
+           if (diff[idx].length === 1) {break}
        }
        return [diff.slice(0,idx), diff.slice(idx)]
     },