Skip to content

Commit

Permalink
Merge pull request #466 from ONLYOFFICE/hotfix/do-not-scale-in-editors
Browse files Browse the repository at this point in the history
fix: don't zoom the page when the user clicks on the canvas
  • Loading branch information
LinneyS authored Mar 4, 2024
2 parents 1ce9727 + d8d0226 commit 4f54b43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@
if (OCA.Onlyoffice.version > 0) {
OCA.Onlyoffice.onRequestHistory(OCA.Onlyoffice.version);
}

OCA.Onlyoffice.setViewport();
};

OCA.Onlyoffice.onRequestSaveAs = function (event) {
Expand Down Expand Up @@ -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);
6 changes: 6 additions & 0 deletions js/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4f54b43

Please sign in to comment.