Commit d908dfb8 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

js/model_loader.js: trigger the old 5/4/3 fields conversion only when necessary

Now the tests added in the previous commit are working.
parent 6eadc191
......@@ -594,7 +594,11 @@ Model_loader.prototype = {
* Convert 1-based positions (json, except old files for 5/4/3) to 0-based positions (js)
*/
convertSeg: function(seg) {
var segMappingZeroBased = true;
// Detects whether we have an old file (before 3e340e1/32aaa23)
var segMappingZeroBased =
((typeof seg['5'] != 'undefined' && typeof seg['5']['end'] != 'undefined')) ||
(typeof seg['5end'] != 'undefined')
var segMapping = ['5', '4', '3'];
var newSeg = {};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment