From 3d89eed31a2303bfbfc9bfd4351d3dd7568ebf6d Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 20 Jul 2020 09:49:40 +0100 Subject: [PATCH] tests: Further scroll fix for bug in Chrome 55-59 with scrollTo not working (#4185) --- src/static/js/broadcast.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/static/js/broadcast.js b/src/static/js/broadcast.js index 4b7d02127..dfcee88ce 100644 --- a/src/static/js/broadcast.js +++ b/src/static/js/broadcast.js @@ -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); + } } }