Skip to content

Commit

Permalink
Fix track selection, fixes #39
Browse files Browse the repository at this point in the history
  • Loading branch information
bctcvai committed Jan 7, 2020
1 parent 981ac76 commit 0ea0846
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions main/static/js/annotator/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1486,14 +1486,18 @@ class AnnotationCanvas extends TatorElement
{
const frame = track.association.segments[0][0];
this.gotoFrame(frame).then(() => {
// TODO: This lookup isn't very scalable; we shouldn't iterate over
// all localizations to find the track
this._data._dataByType.forEach((value, key, map) => {
if (key != track.meta) {
for (const localization of value) {
const sameId = this._data._trackDb[localization.id].id == track.id;
const firstFrame = localization.frame == frame;
if (sameId && firstFrame) {
this.selectLocalization(localization, true);
return;
if (localization.id in this._data._trackDb) {
const sameId = this._data._trackDb[localization.id].id == track.id;
const firstFrame = localization.frame == frame;
if (sameId && firstFrame) {
this.selectLocalization(localization, true);
return;
}
}
}
}
Expand Down

0 comments on commit 0ea0846

Please sign in to comment.