]> _ Git - fluidbook-html5.git/commitdiff
wait #6921 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 23 May 2024 13:02:26 +0000 (15:02 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 23 May 2024 13:02:26 +0000 (15:02 +0200)
js/libs/fluidbook/fluidbook.utils.js

index e82276a0fb5df0a5d96b12d13e55fb5b57fd6259..c3c832c83c67c89d15b6159e087db765208b7c15 100644 (file)
@@ -157,10 +157,10 @@ function parseTransformOriginComponent(c) {
 }
 
 function relayIframeScrollToView(iframe) {
-    var view = iframe.parent().parent();
-    console.log(view, this);
-    $(this).on('load', function () {
-        var body = $(this).contents().find('body');
+
+
+    let callback = function (iframe) {
+        var body = $(iframe).contents().find('body');
         var m = 25;
         $(body).on('mousewheel', function (e) {
             var d = (e.deltaY * m);
@@ -170,5 +170,14 @@ function relayIframeScrollToView(iframe) {
             }
             $(view).scrollTo(v);
         });
+    }
+
+    var view = iframe.parent().parent();
+    callback(iframe);
+
+    $(iframe).on('load', function () {
+        callback(this);
     });
+
+
 }