(lineNumber)
| 245 | } |
| 246 | |
| 247 | const goToLineNumber = (lineNumber) => { |
| 248 | // Sets the Y scrolling of the browser to go to this line |
| 249 | const line = $('#innerdocbody').find(`div:nth-child(${lineNumber + 1})`); |
| 250 | const newY = $(line)[0].offsetTop; |
| 251 | const ecb = document.getElementById('editorcontainerbox'); |
| 252 | // Chrome 55 - 59 bugfix |
| 253 | if (ecb.scrollTo) { |
| 254 | ecb.scrollTo({top: newY, behavior: 'auto'}); |
| 255 | } else { |
| 256 | $('#editorcontainerbox').scrollTop(newY); |
| 257 | } |
| 258 | }; |
| 259 | |
| 260 | goToLineNumber(lineChanged); |
| 261 | } |