Merge pull request #291 from nextcloud/mobile/get_notified_when_doc_is_loaded

Notify clients when the document is fully loaded
This commit is contained in:
Roeland Jago Douma 2018-10-29 10:14:50 +01:00 коммит произвёл GitHub
Родитель e25a828eeb 8d853c2121
Коммит d09fa8b758
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -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');
}
}
}
}
};