removed unnecessary switch case

This commit is contained in:
psychobunny
2014-03-12 16:12:23 -04:00
parent 8e4c23149c
commit b515995432

View File

@@ -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;
}
} }
} }