| new Param("br-headerfirstpageonly",["table"]), | new Param("br-headerfirstpageonly",["table"]), | ||||
| new Param("br-landscapetable",["table"]), | new Param("br-landscapetable",["table"]), | ||||
| new Param("br-transformrotate",["div", "table"]), | new Param("br-transformrotate",["div", "table"]), | ||||
| new Param("br-isolatedlandscape",["div", "table"]) | |||||
| new Param("br-isolatedlandscape",["div", "table"]), | |||||
| new Param("br-hidechildren",["div"]) | |||||
| ]; | ]; | ||||
| } | } | ||||
| @media print{ | |||||
| .hide-child{ | |||||
| display: none !important; | |||||
| } | |||||
| } |
| import './hide-child.css'; | |||||
| import { Transform } from "../transform"; | |||||
| import $ from 'jquery'; | |||||
| export class Hidechildren extends Transform { | |||||
| constructor(param) { | |||||
| super(param); | |||||
| this.object = param.object; | |||||
| this.children = this.object.children; | |||||
| this.class = null; | |||||
| } | |||||
| execute() { | |||||
| for (var i = 0; i < this.children.length; i++) { | |||||
| if (this.children[i].attributes.code) { | |||||
| if (this.children[i].attributes.code.value !== "keep") { | |||||
| $(this.children[i]).addClass('hide-child'); | |||||
| } | |||||
| }else{ | |||||
| $(this.children[i]).addClass('hide-child'); | |||||
| } | |||||
| } | |||||
| this.class = this.object.parentElement.attributes.class.value; | |||||
| $(this.object.parentElement).removeClass(); | |||||
| } | |||||
| rolback() { | |||||
| for (var i = 0; i < this.children.length; i++) { | |||||
| $(this.children[i]).removeClass('hide-child'); | |||||
| if (this.class) { | |||||
| $(this.object.parentElement).addClass(this.class); | |||||
| } | |||||
| } | |||||
| } | |||||
| } |
| import { HeaderFirstPageOnlyTransform } from "./transformations/header-transformations/header-first-page-only-transformation"; | import { HeaderFirstPageOnlyTransform } from "./transformations/header-transformations/header-first-page-only-transformation"; | ||||
| import { TransformRotate } from "./transformations/transform-rotate"; | import { TransformRotate } from "./transformations/transform-rotate"; | ||||
| import { IsolatedLandscapeTransformation } from "./transformations/isolated-landscape-transformation"; | import { IsolatedLandscapeTransformation } from "./transformations/isolated-landscape-transformation"; | ||||
| import { Hidechildren } from "./transformations/hide-children/hide-children"; | |||||
| export class TransformsFactory { | export class TransformsFactory { | ||||
| produce(code, object, selectors) { | produce(code, object, selectors) { | ||||
| return new TransformRotate(param); | return new TransformRotate(param); | ||||
| case "br-isolatedlandscape": | case "br-isolatedlandscape": | ||||
| return new IsolatedLandscapeTransformation(param); | return new IsolatedLandscapeTransformation(param); | ||||
| case "br-hidechildren": | |||||
| return new Hidechildren(param); | |||||
| } | } | ||||
| return null; | return null; |