소스 검색

Merged conflicts with Igor's code

master
Safet Purkovic 4 년 전
부모
커밋
47b2b6a3dc

+ 2
- 1
src/parameters/contracts.js 파일 보기

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"])
]; ];
} }



+ 5
- 0
src/transformations/hide-children/hide-child.css 파일 보기

@media print{
.hide-child{
display: none !important;
}
}

+ 35
- 0
src/transformations/hide-children/hide-children.js 파일 보기

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);
}
}
}
}

+ 3
- 0
src/transforms-factory.js 파일 보기

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;

Loading…
취소
저장