tests: Further scroll fix for bug in Chrome 55-59 with scrollTo not working (#4185)

pull/4186/head^2
John McLear 2020-07-20 09:49:40 +01:00 committed by GitHub
parent c394b65e75
commit 3d89eed31a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -596,7 +596,13 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
var line = $('#innerdocbody').find("div:nth-child("+(lineNumber+1)+")");
var newY = $(line)[0].offsetTop;
var ecb = document.getElementById('editorcontainerbox');
ecb.scrollTo({top: newY, behavior: 'smooth'});
// Cjrome 55 - 59 bugfix
if(ecb.scrollTo){
ecb.scrollTo({top: newY, behavior: 'smooth'});
}else{
// note the p..
ecb.scrollTop(newY);
}
}
}