Skip to content

Commit

Permalink
Small fixes to headerTextColour and headerBgColour
Browse files Browse the repository at this point in the history
 - Don't remove banner (but dón't know which is better
 - If one of the two is empty, error occurs
 - If only text color is set nothing happened
  • Loading branch information
torinfo committed Jun 29, 2022
1 parent 4434af0 commit b2f63f3
Showing 1 changed file with 11 additions and 4 deletions.
Expand Up @@ -2520,6 +2520,7 @@ function x_changePageStep6() {
if (x_pageInfo[x_currentPage].built != false) {
x_doDeepLink();
}

}

function x_focusPageContents(firstLoad) {
Expand Down Expand Up @@ -2791,10 +2792,16 @@ function x_pageLoaded() {
}

// Check if page headerBgColour/headerTextColour has been set
if (x_currentPageXML.getAttribute('headerBgColor') != undefined && x_currentPageXML.getAttribute('headerBgColor') != '') {
let customHeaderStyle = 'background-image: none;';
customHeaderStyle += 'background-color: ' + formatColour(x_currentPageXML.getAttribute('headerBgColor')) + ';';
customHeaderStyle += 'color: ' + formatColour(x_currentPageXML.getAttribute('headerTextColor')) + ';';
if ((x_currentPageXML.getAttribute("headerBgColor") != undefined && x_currentPageXML.getAttribute("headerBgColor") != "") || (x_currentPageXML.getAttribute("headerTextColor") != undefined && x_currentPageXML.getAttribute("headerTextColor") != "")) {
const bgCol = x_currentPageXML.getAttribute("headerBgColor");
const textCol = x_currentPageXML.getAttribute("headerTextColor");
let customHeaderStyle = '';
if (bgCol != undefined && bgCol != "") {
customHeaderStyle += 'background-color: ' + formatColour(bgCol) + ';';
}
if (textCol != undefined && textCol != "") {
customHeaderStyle += 'color: ' + formatColour(x_currentPageXML.getAttribute('headerTextColor')) + ';';
}
customHeaderStyle = '<style type="text/css">#x_headerBlock {' + customHeaderStyle + '}</style>';
$('#x_page' + x_currentPage).append(customHeaderStyle);
}
Expand Down

0 comments on commit b2f63f3

Please sign in to comment.