fix: , FUOC on app.reskin()

v1.18.x
Julian Lam
parent f4cc3122a5
commit 954af0f0d2

@ -764,15 +764,24 @@ app.cacheBuster = null;
if (!clientEl) { if (!clientEl) {
return; return;
} }
// Update client.css link element to point to selected skin variant
clientEl.href = config.relative_path + '/assets/client' + (skinName ? '-' + skinName : '') + '.css';
var currentSkinClassName = $('body').attr('class').split(/\s+/).filter(function (className) { var linkEl = document.createElement('link');
return className.startsWith('skin-'); linkEl.rel = 'stylesheet';
}); linkEl.type = 'text/css';
$('body').removeClass(currentSkinClassName.join(' ')); linkEl.href = config.relative_path + '/assets/client' + (skinName ? '-' + skinName : '') + '.css';
if (skinName) { linkEl.onload = function () {
$('body').addClass('skin-' + skinName); clientEl.parentNode.removeChild(clientEl);
}
// Update body class with proper skin name
var currentSkinClassName = $('body').attr('class').split(/\s+/).filter(function (className) {
return className.startsWith('skin-');
});
$('body').removeClass(currentSkinClassName.join(' '));
if (skinName) {
$('body').addClass('skin-' + skinName);
}
};
document.head.appendChild(linkEl);
}; };
}()); }());

Loading…
Cancel
Save