Named page:first content:element ( ... ) is overwitten
Hello,
When using named pages I want to set the first page to a different header/footer than the following pages. Just the content:element(...) is getting over-written by the other pages (other styles like colour work).
#foobar {
page:foobar;
}
#first_header {
position:running(H_first_header);
}
#other_headers {
position:running(H_other_headers);
}
@page foobar {
@top-left {
content: element(H_other_headers);
background-color: red;
}
}
@page foobar:first {
@top-left {
content: element(H_first_header);
background-color: blue;
}
}
I've managed to find a fix but have no idea if it's the right way to sort it.
In modules/generated-content/running-headers.js
line:149 I changed:
switch (parts.length) {
case 4:
if (parts[3] === "pagedjs_first_page" || parts[3].match(/pagedjs_[\w-]+_first_page/g) ) { // Added check for 1st named page
weight = 7;
} else if (parts[3] === "pagedjs_left_page" || parts[3] === "pagedjs_right_page") {
weight = 6;
}
break;
P.S are there any docs for the code to better understand what parts do what?