From 345ea32c7c60a83f834af2a0ea3ca77ce3cd3538 Mon Sep 17 00:00:00 2001 From: Cu Ly <61442956+culy247@users.noreply.github.com> Date: Thu, 7 Nov 2024 14:22:02 +0700 Subject: [PATCH] Update embed-public.js set timeout 5s reload iframe --- js/embed-public.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/embed-public.js b/js/embed-public.js index 782fe57..b24d539 100644 --- a/js/embed-public.js +++ b/js/embed-public.js @@ -22,7 +22,14 @@ jQuery(function($) { if (! isNativeViewer) { $iframe.css('visibility', 'visible'); } + + // fix so sometimes google doc viewer return 204 no content + timerId = setInterval(function () { + $("iframe.ead-iframe").attr("src", $activeIframe.attr("src")); + }, 5000); + $iframe.on('load', function() { + clearInterval(timerId); $(this).parents('.ead-document').find('.ead-document-loading').css('display', 'none'); });