diff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.js index 2aa4bc8861..50933ff193 100644 --- a/public/src/forum/admin/themes.js +++ b/public/src/forum/admin/themes.js @@ -21,34 +21,30 @@ define(['forum/admin/settings'], function(Settings) { var target = $(e.target), action = target.attr('data-action'); - if (action) { - switch (action) { - case 'use': - var parentEl = target.parents('li'), - themeType = parentEl.attr('data-type'), - cssSrc = parentEl.attr('data-css'), - themeId = parentEl.attr('data-theme'); - - socket.emit('admin.themes.set', { - type: themeType, - id: themeId, - src: cssSrc - }, function(err) { - if (err) { - return app.alertError(err.message); - } - highlightSelectedTheme(themeId); - - app.alert({ - alert_id: 'admin:theme', - type: 'success', - title: 'Theme Changed', - message: 'Restarting your NodeBB ', - timeout: 3500 - }); - }); - break; - } + if (action && action === 'use') { + var parentEl = target.parents('li'), + themeType = parentEl.attr('data-type'), + cssSrc = parentEl.attr('data-css'), + themeId = parentEl.attr('data-theme'); + + socket.emit('admin.themes.set', { + type: themeType, + id: themeId, + src: cssSrc + }, function(err) { + if (err) { + return app.alertError(err.message); + } + highlightSelectedTheme(themeId); + + app.alert({ + alert_id: 'admin:theme', + type: 'success', + title: 'Theme Changed', + message: 'Restarting your NodeBB ', + timeout: 3500 + }); + }); } }