This commit is contained in:
Zuzanna Ludzik 2026-08-03 12:55:17 +02:00
parent cc675f400d
commit dc30486d8f

View File

@ -127,6 +127,46 @@ define([
return cancelBlock;
};
var nativePrint = window.print.bind(window);
var printFullContent = function () {
var target = document.querySelector('.cp-form-creator-container');
if (!target) { nativePrint(); return; }
var prevHeight = target.style.height;
var prevOverflow = target.style.overflow;
var prevOverflowY = target.style.overflowY;
var prevMaxHeight = target.style.maxHeight;
target.style.setProperty('height', 'auto', 'important');
target.style.setProperty('max-height', 'none', 'important');
target.style.setProperty('overflow', 'visible', 'important');
target.style.setProperty('overflow-y', 'visible', 'important');
var restore = function () {
target.style.height = prevHeight;
target.style.overflow = prevOverflow;
target.style.overflowY = prevOverflowY;
target.style.maxHeight = prevMaxHeight;
window.onafterprint = null;
};
window.onafterprint = restore;
setTimeout(restore, 60000);
setTimeout(function () { nativePrint(); }, 50);
};
window.print = printFullContent;
window.addEventListener('keydown', function (e) {
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'p') {
e.preventDefault();
printFullContent();
}
});
var editTextOptions = function (opts, setCursorGetter, cb) {
var evOnSave = Util.mkEvent();