Merge pull request #829 from dolanmiu/feat/even-odd-headers
#251 Turning off default headers by default
This commit is contained in:
@ -57,9 +57,8 @@ describe("File", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const tree = new Formatter().format(doc.Document.View.Body);
|
const tree = new Formatter().format(doc.Document.View.Body);
|
||||||
|
expect(tree["w:body"][0]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("first");
|
||||||
expect(tree["w:body"][0]["w:sectPr"][5]["w:headerReference"]._attr["w:type"]).to.equal("first");
|
expect(tree["w:body"][0]["w:sectPr"][5]["w:footerReference"]._attr["w:type"]).to.equal("first");
|
||||||
expect(tree["w:body"][0]["w:sectPr"][7]["w:footerReference"]._attr["w:type"]).to.equal("first");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should create with correct headers", () => {
|
it("should create with correct headers", () => {
|
||||||
|
@ -164,12 +164,12 @@ export class File {
|
|||||||
this.documentWrapper.View.Body.addSection({
|
this.documentWrapper.View.Body.addSection({
|
||||||
...properties,
|
...properties,
|
||||||
headers: {
|
headers: {
|
||||||
default: headers.default ? this.createHeader(headers.default) : this.createHeader(new Header()),
|
default: headers.default ? this.createHeader(headers.default) : undefined,
|
||||||
first: headers.first ? this.createHeader(headers.first) : undefined,
|
first: headers.first ? this.createHeader(headers.first) : undefined,
|
||||||
even: headers.even ? this.createHeader(headers.even) : undefined,
|
even: headers.even ? this.createHeader(headers.even) : undefined,
|
||||||
},
|
},
|
||||||
footers: {
|
footers: {
|
||||||
default: footers.default ? this.createFooter(footers.default) : this.createFooter(new Footer()),
|
default: footers.default ? this.createFooter(footers.default) : undefined,
|
||||||
first: footers.first ? this.createFooter(footers.first) : undefined,
|
first: footers.first ? this.createFooter(footers.first) : undefined,
|
||||||
even: footers.even ? this.createFooter(footers.even) : undefined,
|
even: footers.even ? this.createFooter(footers.even) : undefined,
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user