Skip to content

Commit

Permalink
Do not load 'theme' css if default them is chosen
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed Jan 25, 2023
1 parent e9c50ae commit d7ae326
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions modules/xerte/parent_templates/Nottingham/common_html5/js/xenith.js
Expand Up @@ -2809,17 +2809,23 @@ function x_closeStandAlonePage(event) {
}

function x_changePageStep2(x_gotoPage) {
x_insertCSS(x_themePath + x_params.theme + '/' + x_params.theme + '.css', function () {
x_changePageStep3(x_gotoPage);
}, false, "theme_css", true);
if (x_params.theme != undefined) {
x_insertCSS(x_themePath + x_params.theme + '/' + x_params.theme + '.css', function () {
x_changePageStep3(x_gotoPage);
}, false, "theme_css", true);
}
else {
x_changePageStep3(x_gotoPage);
}
}

function x_changePageStep3(x_gotoPage) {
var css = document.getElementById('theme_css');
css.load = function()
{
var i=1;
};
if (x_params.theme != undefined) {
var css = document.getElementById('theme_css');
css.load = function () {
var i = 1;
};
}

if (x_params.theme != undefined && x_params.theme != "default") {
// adds responsiveText.css for theme if it exists - in some circumstances this will be immediately disabled
Expand Down Expand Up @@ -4548,11 +4554,18 @@ function x_saveSessionBtnIsStyled() {
return s.href && s.href.indexOf('/themes/Nottingham/')>0 && s.href.indexOf('responsivetext')<0 ? s : null;
});

var isStyled = files.reduce(function(a,r){
return [].slice.call(r.rules).reduce(function(a,r){
return (r.cssText && r.cssText.indexOf('x_saveSession')>0) || a;
}, false) || a;
}, false);
try {
var isStyled = files.reduce(function (a, r) {
return [].slice.call(r.rules).reduce(function (a, r) {
return (r.cssText && r.cssText.indexOf('x_saveSession') > 0) || a;
}, false) || a;
}, false);
}
catch (e)
{
console.log("Error checking whether saveSession button is styled in theme: " + e);
return false;
}
return isStyled;
}

Expand Down

0 comments on commit d7ae326

Please sign in to comment.