Skip to content

Commit

Permalink
[wopi] for bug 59054
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkadushkin committed Mar 26, 2024
1 parent 909f638 commit 78935ee
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions web/documentserver-example/nodejs/views/wopiAction.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@
frameholder.appendChild(office_frame);
document.getElementById('office_form').submit();
var _onMessage = function(msg) {
var data = msg.data;
if (Object.prototype.toString.apply(data) !== '[object String]' || !window.JSON) {
return;
}
var cmd = JSON.parse(data);
if (cmd) {
if ( cmd.MessageId == 'UI_DocumentReady' ) {
var fixSize = function() {
document.getElementsByTagName("iframe")[0].style.height = window.innerHeight + "px";
}
fixSize();
window.addEventListener("orientationchange", fixSize);
}
}
};
window.addEventListener('message', function (e) {
_onMessage(e);
});
</script>

</body>
Expand Down

0 comments on commit 78935ee

Please sign in to comment.