mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-06 23:00:08 +01:00
fix: #7276 improper request for client-noskin.css
This commit is contained in:
@@ -149,7 +149,7 @@ app.cacheBuster = null;
|
|||||||
Unread.initUnreadTopics();
|
Unread.initUnreadTopics();
|
||||||
Notifications.prepareDOM();
|
Notifications.prepareDOM();
|
||||||
Chat.prepareDOM();
|
Chat.prepareDOM();
|
||||||
app.reskin(data.config.bootswatchSkin);
|
app.reskin(data.header.bootswatchSkin);
|
||||||
translator.switchTimeagoLanguage(callback);
|
translator.switchTimeagoLanguage(callback);
|
||||||
bootbox.setLocale(config.userLang);
|
bootbox.setLocale(config.userLang);
|
||||||
|
|
||||||
@@ -770,6 +770,17 @@ app.cacheBuster = null;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var currentSkinClassName = $('body').attr('class').split(/\s+/).filter(function (className) {
|
||||||
|
return className.startsWith('skin-');
|
||||||
|
});
|
||||||
|
var currentSkin = currentSkinClassName[0].slice(5);
|
||||||
|
currentSkin = currentSkin !== 'noskin' ? currentSkin : '';
|
||||||
|
|
||||||
|
// Stop execution if skin didn't change
|
||||||
|
if (skinName === currentSkin) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var linkEl = document.createElement('link');
|
var linkEl = document.createElement('link');
|
||||||
linkEl.rel = 'stylesheet';
|
linkEl.rel = 'stylesheet';
|
||||||
linkEl.type = 'text/css';
|
linkEl.type = 'text/css';
|
||||||
@@ -778,13 +789,8 @@ app.cacheBuster = null;
|
|||||||
clientEl.parentNode.removeChild(clientEl);
|
clientEl.parentNode.removeChild(clientEl);
|
||||||
|
|
||||||
// Update body class with proper skin name
|
// 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(' '));
|
$('body').removeClass(currentSkinClassName.join(' '));
|
||||||
if (skinName) {
|
$('body').addClass('skin-' + (skinName || 'noskin'));
|
||||||
$('body').addClass('skin-' + skinName);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
document.head.appendChild(linkEl);
|
document.head.appendChild(linkEl);
|
||||||
|
|||||||
Reference in New Issue
Block a user