cheating fix for 2 columns layout

master
km0 3 years ago
parent 9cf053b92c
commit cf13c311cb

@ -11,12 +11,21 @@ const printLib = document.getElementById("btn-print");
window.addEventListener("load", () => {
fetchContents();
atlasLink();
//document.getElementsByTagName("head")[0].appendChild(pagedjs);
});
printLib.addEventListener("click", () => {
printViewToggle();
console.log(btnPrint);
document.getElementsByTagName("head")[0].appendChild(pagedjs);
// pardon for this is really stupid but it works
setTimeout(() => {
let sections = [".libretto", ".container", ".content", ".contribution", ".contributions"];
for (const section of sections) {
for (const el of document.querySelectorAll(section)) {
el.classList.add("full-height");
}
}
}, 1000);
});
function fetchContents() {
@ -57,10 +66,11 @@ function atlasLink() {
}
function createIndexSection(contribution) {
let table = document.createElement("table");
let title = document.createElement("h4");
title.innerHTML = contribution.title;
if (contribution.audio){
if (contribution.audio) {
let table = document.createElement("table");
let title = document.createElement("div");
title.classList.add("index-title");
title.innerHTML = contribution.title;
let tracks = contribution.audio;
tracks.forEach((track) => {
let row = document.createElement("tr");
@ -73,21 +83,7 @@ function createIndexSection(contribution) {
row.appendChild(col2);
table.appendChild(row);
});
}
trackList.appendChild(title);
trackList.appendChild(table);
}
function printViewToggle() {
var printview = document.getElementById("printview");
if (!printview) {
document.getElementsByTagName("head")[0].appendChild(pagedjs);
// sto provando sta porcata qui, ma non funzia uguale. quando la pagina si trasforma in pagedjs la variabile del btn non è più definita (????)
var btnPrint = document.getElementById("btn-print");
console.log(btnPrint);
} else {
//document.getElementsByTagName("head")[0].removeChild(printview);
pagejs.remove();
console.log("aooooo che cazzo");
trackList.appendChild(title);
trackList.appendChild(table);
}
}

@ -2,10 +2,10 @@
@page {
size: A5;
margin-top: 10mm;
margin-right: 20mm;
margin-bottom: 25mm;
margin-left: 15mm;
margin-top: 5mm;
margin-right: 10mm;
margin-bottom: 20mm;
margin-left: 7.5mm;
}
html, body {
@ -16,19 +16,26 @@
display: block;
width: auto;
height: auto;
}
/* .container,
.libretto{
height: 100%;
} */
.atlas {
border: none;
}
.atlas svg {
height: 100%;
width: 100%;
}
.index-title {
font-weight: bold;
margin-top: 16px;
}
.contributions,
.contribution {
border-bottom: none;
@ -78,8 +85,8 @@
}
.libretto {
overflow-y: hidden;
overflow-x: hidden;
overflow: hidden;
/* height:100%; */
}
.libretto > *{
@ -97,9 +104,11 @@
overflow: hidden;
}
/*Sorry Gi, the multicolumn layout is too painful */
.contribution .content{
column-count: 2;
column-fill: auto;
}
@ -116,4 +125,9 @@
display: none;
}
.full-height {
height: 100%;
}
}
Loading…
Cancel
Save