mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
feat: #10276, dont change/revert theme if its current
This commit is contained in:
@@ -15,6 +15,9 @@ define('admin/appearance/themes', ['bootbox', 'translator', 'alerts'], function
|
|||||||
const cssSrc = parentEl.attr('data-css');
|
const cssSrc = parentEl.attr('data-css');
|
||||||
const themeId = parentEl.attr('data-theme');
|
const themeId = parentEl.attr('data-theme');
|
||||||
|
|
||||||
|
if (config['theme:id'] === themeId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
socket.emit('admin.themes.set', {
|
socket.emit('admin.themes.set', {
|
||||||
type: themeType,
|
type: themeType,
|
||||||
id: themeId,
|
id: themeId,
|
||||||
@@ -43,6 +46,9 @@ define('admin/appearance/themes', ['bootbox', 'translator', 'alerts'], function
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#revert_theme').on('click', function () {
|
$('#revert_theme').on('click', function () {
|
||||||
|
if (config['theme:id'] === 'nodebb-theme-persona') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
bootbox.confirm('[[admin/appearance/themes:revert-confirm]]', function (confirm) {
|
bootbox.confirm('[[admin/appearance/themes:revert-confirm]]', function (confirm) {
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
socket.emit('admin.themes.set', {
|
socket.emit('admin.themes.set', {
|
||||||
@@ -52,6 +58,7 @@ define('admin/appearance/themes', ['bootbox', 'translator', 'alerts'], function
|
|||||||
if (err) {
|
if (err) {
|
||||||
return alerts.error(err);
|
return alerts.error(err);
|
||||||
}
|
}
|
||||||
|
config['theme:id'] = 'nodebb-theme-persona';
|
||||||
highlightSelectedTheme('nodebb-theme-persona');
|
highlightSelectedTheme('nodebb-theme-persona');
|
||||||
alerts.alert({
|
alerts.alert({
|
||||||
alert_id: 'admin:theme',
|
alert_id: 'admin:theme',
|
||||||
|
|||||||
Reference in New Issue
Block a user