Skip to content

Commit

Permalink
Fixes #956 (overlapping fragments)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goran Topic committed Nov 7, 2012
1 parent d4087c5 commit bada687
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/annotator_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1633,14 +1633,15 @@ var AnnotatorUI = (function($, window, undefined) {

var newOffset = [selectedFrom, selectedTo];
if (reselectedSpan) {
var newOffsets = reselectedSpan.offsets.slice(0); // clone
spanOptions.old_offsets = JSON.stringify(reselectedSpan.offsets);
if (selectedFragment !== null) {
if (selectedFragment !== false) {
reselectedSpan.offsets.splice(selectedFragment, 1);
newOffsets.splice(selectedFragment, 1);
}
reselectedSpan.offsets.push(newOffset);
reselectedSpan.offsets.sort(Util.cmpArrayOnFirstElement);
spanOptions.offsets = reselectedSpan.offsets;
newOffsets.push(newOffset);
newOffsets.sort(Util.cmpArrayOnFirstElement);
spanOptions.offsets = newOffsets;
} else {
spanOptions.offsets = [newOffset];
}
Expand Down

0 comments on commit bada687

Please sign in to comment.