From 8d853c2121a5b5def2b7d4e50a8021c367bc37ba Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 29 Oct 2018 08:27:02 +0100 Subject: [PATCH] Notify clients when the document is fully loaded Signed-off-by: Roeland Jago Douma --- js/documents.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/js/documents.js b/js/documents.js index 276a642c7..33888349c 100644 --- a/js/documents.js +++ b/js/documents.js @@ -436,6 +436,19 @@ var documentsMain = { } else if (msg.Values.Status === "Document_Loaded" ) { documentsMain.overlay.documentOverlay('hide'); window.removeEventListener('message', editorInitListener, false); + + // Forward to mobile handler + if (window.RichDocumentsMobileInterface) { + window.RichDocumentsMobileInterface.documentLoaded(); + } + + // iOS webkit fallback + if (window.webkit + && window.webkit.messageHandlers + && window.webkit.messageHandlers.RichDocumentsMobileInterface) { + window.webkit.messageHandlers.RichDocumentsMobileInterface.postMessage('documentLoaded'); + } + } } } };