mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #7176, FUOC on app.reskin()
This commit is contained in:
@@ -764,9 +764,15 @@ app.cacheBuster = null;
|
||||
if (!clientEl) {
|
||||
return;
|
||||
}
|
||||
// Update client.css link element to point to selected skin variant
|
||||
clientEl.href = config.relative_path + '/assets/client' + (skinName ? '-' + skinName : '') + '.css';
|
||||
|
||||
var linkEl = document.createElement('link');
|
||||
linkEl.rel = 'stylesheet';
|
||||
linkEl.type = 'text/css';
|
||||
linkEl.href = config.relative_path + '/assets/client' + (skinName ? '-' + skinName : '') + '.css';
|
||||
linkEl.onload = function () {
|
||||
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-');
|
||||
});
|
||||
@@ -775,4 +781,7 @@ app.cacheBuster = null;
|
||||
$('body').addClass('skin-' + skinName);
|
||||
}
|
||||
};
|
||||
|
||||
document.head.appendChild(linkEl);
|
||||
};
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user