mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
removed unnecessary switch case
This commit is contained in:
@@ -21,34 +21,30 @@ define(['forum/admin/settings'], function(Settings) {
|
|||||||
var target = $(e.target),
|
var target = $(e.target),
|
||||||
action = target.attr('data-action');
|
action = target.attr('data-action');
|
||||||
|
|
||||||
if (action) {
|
if (action && action === 'use') {
|
||||||
switch (action) {
|
var parentEl = target.parents('li'),
|
||||||
case 'use':
|
themeType = parentEl.attr('data-type'),
|
||||||
var parentEl = target.parents('li'),
|
cssSrc = parentEl.attr('data-css'),
|
||||||
themeType = parentEl.attr('data-type'),
|
themeId = parentEl.attr('data-theme');
|
||||||
cssSrc = parentEl.attr('data-css'),
|
|
||||||
themeId = parentEl.attr('data-theme');
|
|
||||||
|
|
||||||
socket.emit('admin.themes.set', {
|
socket.emit('admin.themes.set', {
|
||||||
type: themeType,
|
type: themeType,
|
||||||
id: themeId,
|
id: themeId,
|
||||||
src: cssSrc
|
src: cssSrc
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return app.alertError(err.message);
|
return app.alertError(err.message);
|
||||||
}
|
}
|
||||||
highlightSelectedTheme(themeId);
|
highlightSelectedTheme(themeId);
|
||||||
|
|
||||||
app.alert({
|
app.alert({
|
||||||
alert_id: 'admin:theme',
|
alert_id: 'admin:theme',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
title: 'Theme Changed',
|
title: 'Theme Changed',
|
||||||
message: 'Restarting your NodeBB <i class="fa fa-refresh fa-spin"></i>',
|
message: 'Restarting your NodeBB <i class="fa fa-refresh fa-spin"></i>',
|
||||||
timeout: 3500
|
timeout: 3500
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user