MCPcopy Create free account
hub / github.com/ether/etherpad / goToLineNumber

Function goToLineNumber

src/static/js/broadcast.ts:247–258  ·  view source on GitHub ↗
(lineNumber)

Source from the content-addressed store, hash-verified

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 }

Callers 1

applyChangesetFunction · 0.85

Calls 1

findMethod · 0.80

Tested by

no test coverage detected