twst btn print view and column layout commented

master
grgr 3 years ago
parent 72f3eed19f
commit aac5750e25

@ -5,7 +5,7 @@ const pagedjs = document.createElement("script");
pagedjs.src = "https://unpkg.com/pagedjs/dist/paged.polyfill.js";
pagedjs.id ="printview"
const printLib = document.getElementById("print");
const printLib = document.getElementById("btn-print");
window.addEventListener("load", () => {
fetchContents();
@ -13,7 +13,10 @@ window.addEventListener("load", () => {
//document.getElementsByTagName("head")[0].appendChild(pagedjs);
});
printLib.addEventListener("click", () => printViewToggle())
printLib.addEventListener("click", () =>{
printViewToggle();
console.log(btnPrint);
});
function fetchContents() {
fetch("https://hub.xpub.nl/soupboat/atlas-api/contributions")
@ -57,7 +60,9 @@ function printViewToggle() {
if (!printview) {
document.getElementsByTagName("head")[0].appendChild(pagedjs);
console.log("first")
// 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);

@ -14,7 +14,7 @@
<body>
<div class="container">
<div class="atlas">
<button id="print">libretto</button>
<button id="btn-print">libretto</button>
<svg
width="1000"
height="1000"
@ -130,7 +130,7 @@
<div class="position">04:35</div>
</div>
</div>
<div class="libretto">
<div class="libretto" contenteditable="true">
<header class="cover">
<div class="release">SI18 Weekly Release #3</div>
<h1 class="title">Emergent Opera</h1>

@ -62,6 +62,10 @@
display: block;
}
.libretto {
overflow-y: hidden;
}
.contribution .title {
font-size: 28px;
@ -69,9 +73,21 @@
.contribution {
border-bottom: none;
height: 100%;
overflow: hidden;
}
/*Sorry Gi, the multicolumn layout is too painful */
/*
.contribution .content{
column-count: 2;
column-fill: auto;
}
.contribution li{
column-span: none;
}*/
}
Loading…
Cancel
Save