Merge "make scroll position compensation more reliable" into jb-ub-mail-ur8
diff --git a/assets/script.js b/assets/script.js
index 37c266e..215349d 100644
--- a/assets/script.js
+++ b/assets/script.js
@@ -554,10 +554,14 @@
     var deltaScrollX = (scale - 1) * gScaleInfo.originX - gScaleInfo.currTranslateX;
     var deltaScrollY = (scale - 1) * gScaleInfo.originY - gScaleInfo.currTranslateY;
 //    console.log("JS adjusting scroll by x/y=" + deltaScrollX + "/" + deltaScrollY);
-    window.scrollBy(deltaScrollX, deltaScrollY);
 
     msgBodyDiv.classList.remove("zooming-focused");
     msgBodyDiv.setAttribute("data-initial-scale", scale);
+
+    // TODO: is there a better way to make this more reliable?
+    window.setTimeout(function() {
+        window.scrollBy(deltaScrollX, deltaScrollY);
+    }, 10);
 }
 
 function onScale(relativeScale, screenX, screenY) {