From b51599543200f14b627e45b71784974350e00924 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 12 Mar 2014 16:12:23 -0400 Subject: [PATCH] removed unnecessary switch case --- public/src/forum/admin/themes.js | 52 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 28 deletions(-) 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 + }); + }); } }