Revert "fix: Canvas füllt volle Breite (kein 1200px-Limit) + Resize-Listener"
All checks were successful
Deploy bericht / deploy (push) Has been skipped
All checks were successful
Deploy bericht / deploy (push) Has been skipped
This reverts commit 532d8e0c98.
This commit is contained in:
parent
532d8e0c98
commit
0dc3f46817
2 changed files with 4 additions and 13 deletions
|
|
@ -62,9 +62,8 @@
|
||||||
border: 1px solid var(--colorboxbordertitle1, transparent);
|
border: 1px solid var(--colorboxbordertitle1, transparent);
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
min-height: 80vh;
|
||||||
display: flex; flex-direction: column;
|
display: flex; flex-direction: column;
|
||||||
/* keine min-height — Container so groß wie Inhalt */
|
|
||||||
max-height: calc(100vh - 220px);
|
|
||||||
}
|
}
|
||||||
.bericht-toolbar {
|
.bericht-toolbar {
|
||||||
display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
|
display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
|
||||||
|
|
|
||||||
14
js/editor.js
14
js/editor.js
|
|
@ -60,13 +60,6 @@
|
||||||
bindExtraUpload();
|
bindExtraUpload();
|
||||||
bindActions();
|
bindActions();
|
||||||
bindSortable();
|
bindSortable();
|
||||||
|
|
||||||
// Window-Resize: Canvas neu skalieren (debounced)
|
|
||||||
let resizeTimer = null;
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
clearTimeout(resizeTimer);
|
|
||||||
resizeTimer = setTimeout(() => { rerenderCurrent(); }, 200);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- Seiten laden ---------- */
|
/* ---------- Seiten laden ---------- */
|
||||||
|
|
@ -110,16 +103,15 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Liefert die nutzbare Breite des Canvas-Containers (minus Padding).
|
* Liefert die nutzbare Breite des Canvas-Containers (minus Padding).
|
||||||
* KEINE harte Obergrenze — der Canvas füllt immer die volle verfügbare
|
* Begrenzt auf 1200px, damit auch auf großen Screens nicht alles riesig wird.
|
||||||
* Breite der mittleren Spalte aus.
|
|
||||||
*/
|
*/
|
||||||
function getTargetCanvasWidth() {
|
function getTargetCanvasWidth() {
|
||||||
const wrap = document.querySelector('.bericht-canvas-wrap');
|
const wrap = document.querySelector('.bericht-canvas-wrap');
|
||||||
if (!wrap) return 800;
|
if (!wrap) return 800;
|
||||||
const cs = getComputedStyle(wrap);
|
const cs = getComputedStyle(wrap);
|
||||||
const padX = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);
|
const padX = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);
|
||||||
const avail = wrap.clientWidth - padX - 4;
|
const avail = wrap.clientWidth - padX - 4; // 4px Sicherheitsabstand
|
||||||
return Math.max(300, Math.floor(avail));
|
return Math.max(300, Math.min(1200, Math.floor(avail)));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function renderPdf(arrayBuffer) {
|
async function renderPdf(arrayBuffer) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue