diff --git a/js/editor.js b/js/editor.js index 512df2a0..0697cdfc 100644 --- a/js/editor.js +++ b/js/editor.js @@ -267,6 +267,8 @@ if (OCA.Onlyoffice.version > 0) { OCA.Onlyoffice.onRequestHistory(OCA.Onlyoffice.version); } + + OCA.Onlyoffice.setViewport(); }; OCA.Onlyoffice.onRequestSaveAs = function (event) { @@ -661,6 +663,10 @@ OCA.Onlyoffice.docEditor.refreshHistory(data); } + OCA.Onlyoffice.setViewport = function() { + document.querySelector('meta[name="viewport"]').setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"); + }; + $(document).ready(OCA.Onlyoffice.InitEditor); })(jQuery, OCA); diff --git a/js/listener.js b/js/listener.js index e7d41af5..12df57f6 100644 --- a/js/listener.js +++ b/js/listener.js @@ -88,12 +88,18 @@ } else { OCA.Onlyoffice.unbindVersionClick(); } + + OCA.Onlyoffice.setViewport(); }; OCA.Onlyoffice.changeFavicon = function (favicon) { $('link[rel="icon"]').attr("href", favicon); }; + OCA.Onlyoffice.setViewport = function() { + document.querySelector('meta[name="viewport"]').setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"); + }; + OCA.Onlyoffice.onShowMessage = function (messageObj) { OC.Notification.show(messageObj.message, messageObj.props); }