don't fail without scrollIntoViewIfNeeded
This commit is contained in:
parent
54f47b6401
commit
d7ac0f48f8
1 changed files with 4 additions and 1 deletions
|
@ -224,6 +224,9 @@ txtjs.onMessage = function(data, event) {
|
|||
} else if (event == 'addAnnotation') {
|
||||
txtjs.addNoteFromSelection()
|
||||
} else if (event == 'addAnnotations') {
|
||||
if (data.reset) {
|
||||
// fixme
|
||||
}
|
||||
data.annotations.forEach(function(note) {
|
||||
////
|
||||
note.position = note.position.replace(':', ',')
|
||||
|
@ -502,7 +505,7 @@ txtjs.selectNote = function(id, trigger) {
|
|||
})
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
if (!elements[i].parentNode.id.includes('scroll')) {
|
||||
elements[i].scrollIntoViewIfNeeded()
|
||||
elements[i].scrollIntoViewIfNeeded && elements[i].scrollIntoViewIfNeeded()
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue