Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
d908dfb8
Commit
d908dfb8
authored
Jul 26, 2016
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
browser/js/model_loader.js
View file @
d908dfb8
...
...
@@ -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
=
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment