mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
Merge pull request '[common] Fix bug 76072' (#824) from fix/bug-76072 into release/v9.2.0
This commit is contained in:
15
vendor/monaco/MonacoEditorCode.js
vendored
15
vendor/monaco/MonacoEditorCode.js
vendored
@ -150,4 +150,19 @@ var _postMessage = function(msg) {
|
||||
} else {
|
||||
window.addEventListener('message', fn, false);
|
||||
}
|
||||
|
||||
var _onResize = function() {
|
||||
var styleTag = document.getElementById('dynamic-styles');
|
||||
if (!styleTag) {
|
||||
styleTag = document.createElement('style');
|
||||
styleTag.id = 'dynamic-styles';
|
||||
document.head.appendChild(styleTag);
|
||||
}
|
||||
//Calculate tooltip height(20px - height text row)
|
||||
var maxHeight = Math.min((window.innerHeight - 20) / 2, 250);
|
||||
styleTag.textContent = `.monaco-hover { max-height: ${maxHeight}px !important; }`;
|
||||
};
|
||||
|
||||
_onResize();
|
||||
window.addEventListener('resize', _onResize);
|
||||
})(window, undefined);
|
||||
Reference in New Issue
Block a user