Skip to content
Snippets Groups Projects
Commit fb258e15 authored by uhensler's avatar uhensler
Browse files

OO-4878: Make sure the OnlyOffice JS-Library is loaded and ready before invoked

parent 51ddc0e9
No related branches found
No related tags found
No related merge requests found
...@@ -8,9 +8,21 @@ ...@@ -8,9 +8,21 @@
<script src="$apiUrl"></script> <script src="$apiUrl"></script>
<script> <script>
/* <![CDATA[ */ /* <![CDATA[ */
jQuery('$id').ready(function(){ ## Make sure the OnlyOffice JS-Library is loaded and ready.
new DocsAPI.DocEditor("$id", $apiConfig); function loadEditor() {
}); var waitForLoad = function() {
if (typeof DocsAPI != "undefined") {
new DocsAPI.DocEditor("$id", $apiConfig);
} else {
window.setTimeout(waitForLoad, 500);
}
};
window.setTimeout(waitForLoad, 500);
}
jQuery("$id").ready(function() {
loadEditor();
});
/* ]]> */ /* ]]> */
</script> </script>
#end #end
......
...@@ -3,10 +3,4 @@ ...@@ -3,10 +3,4 @@
<div class="o_button_group"> <div class="o_button_group">
$r.render("open.button") $r.render("open.button")
</div> </div>
</div> </div>
<script> \ No newline at end of file
/* <![CDATA[ */
##jQuery(document).ready(function() { $r.backgroundCommand("open"); })
##jQuery(document).ready(function() { $r.openJavaScriptCommand("open")); })
/* ]]> */
</script>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment