Commit 166b5ff3 authored by Julie Blanc's avatar Julie Blanc

correction snapImage (delete max-height)

parent 5e8bc44e
......@@ -26,9 +26,6 @@ figure {
margin-top: 6px;
margin-bottom: 1px;
width: 100%;
object-fit: cover;
object-position: center center;
/* opacity: 0.3; */
}
}
......
......@@ -19,7 +19,7 @@
--color-paper: white;
/* color used for the baseline */
--color-baseline: transparent;
--color-baseline: red;
......
......@@ -15,15 +15,9 @@ class SnapImages extends Paged.Handler {
let heightx = parseInt(varHeightx.replace("px", ""));
let ratio = Math.round((imgheight - heightx)/baseline);
if(ratio < 18){
images[i].style.height = "calc(var(--font-lineHeight)*" + ratio + " + var(--height-x))";
}else{
images[i].style.height = "calc(var(--font-lineHeight)*18 + var(--height-x))";
images[i].style.objectFit = "contain";
}
images[i].style.objectFit = "cover";
images[i].style.objectPosition = "center center";
}
......@@ -37,28 +31,5 @@ Paged.registerHandlers(SnapImages);
class MyHandler extends Paged.Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller);
}
beforePageLayout(page) {
// let pageContent = document.getElementsByClassName("pagejs_page");
// console.log(pageContent);
// for(let p=0;p<pageContent.length;p++){
// console.log(pageContent[p]);
// }
console.log(page.area);
let images = page.area.getElementsByClassName("img-snap");
console.log(images.length);
// let pageContent = page.area;
}
}
Paged.registerHandlers(MyHandler);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment