mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
[common] Fix bug 76072
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 {
|
} else {
|
||||||
window.addEventListener('message', fn, false);
|
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);
|
})(window, undefined);
|
||||||
Reference in New Issue
Block a user