| @@ -17,7 +17,7 @@ const contracts = () => | |||
| new Param("br-bordercolor",["table","div","p"]), | |||
| new Param("br-headereverypage",["p","img"]), | |||
| new Param("br-headerfirstpageonly",["table"]), | |||
| new Param("br-landscapetable",["table"]), | |||
| new Param("br-landscapetable",["table","div"]), | |||
| new Param("br-transformrotate",["div", "table"]), | |||
| new Param("br-isolatedlandscape",["div", "table"]), | |||
| new Param("br-hidechildren",["div", "th", "tr"]), | |||
| @@ -1,6 +1,6 @@ | |||
| /* @media print | |||
| { */ | |||
| table{ | |||
| .landscape{ | |||
| display: block; | |||
| } | |||
| @@ -18,7 +18,7 @@ | |||
| padding: .25em .5em; | |||
| background-color: rgba(255, 255, 255, .8); | |||
| } | |||
| .table-landscape | |||
| .landscape | |||
| { | |||
| max-width: 100vh; | |||
| max-height: 100vw; | |||
| @@ -30,6 +30,6 @@ | |||
| } | |||
| .demo { page-break-before:always } | |||
| /* .demo table { page-break-inside:avoid; page-break-after:auto } */ | |||
| .demo table { page-break-inside: always; } | |||
| .demo .landscape { page-break-inside: always; } | |||
| /* } */ | |||
| @@ -9,9 +9,9 @@ export class LandscapeTableTransform extends Transform | |||
| super(param); | |||
| } | |||
| execute(){ | |||
| $(this.object).addClass('table-landscape'); | |||
| $(this.object).addClass('landscape'); | |||
| } | |||
| rolback(){ | |||
| $(this.object).removeClass('table-landscape'); | |||
| $(this.object).removeClass('landscape'); | |||
| } | |||
| } | |||
| @@ -20,6 +20,8 @@ export class RootTransformation extends Transform | |||
| va.forEach(element => { | |||
| // 59.338582677165356 is sum of default top and bottom print margins | |||
| // 842 is height in pixels for A4 format | |||
| if(!element.hasAttribute('code') || (element.hasAttribute('code') && element.getAttribute('code') != 'br-hide')) | |||
| { | |||
| const razlika = element.clientHeight + temp - (i * 842 - 59.338582677165356); | |||
| if (razlika < 0) { | |||
| temp += element.clientHeight; | |||
| @@ -96,7 +98,7 @@ export class RootTransformation extends Transform | |||
| } | |||
| } | |||
| }); | |||
| }}); | |||
| $('#root').empty(); | |||
| $('#root').append(divRootElement); | |||
| array.forEach(element => { | |||