From 8fe9f864234664af12cfb703f6318058297d8494 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Fri, 15 Aug 2014 17:35:59 -0700 Subject: [PATCH] Clean up redundant code --- client/js/chat.js | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/client/js/chat.js b/client/js/chat.js index f5a1f12d..098f3e04 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -224,15 +224,9 @@ $(function() { }); $.cookie.json = true; + var settings = $("#settings"); - var options = $.extend({ - join: true, - mode: true, - nick: true, - notification: true, - part: true, - quit: true, - }, $.cookie("settings")); + var options = $.extend({notification: true}, $.cookie("settings")); for (var i in options) { if (options[i]) { @@ -242,18 +236,8 @@ $(function() { settings.on("change", "input", function() { var self = $(this); - var name = self.attr("name"); - options[name] = self.prop("checked"); + options[self.attr("name")] = self.prop("checked"); $.cookie("settings", options); - if ([ - "join", - "nick", - "part", - "mode", - "quit", - ].indexOf(name) !== -1) { - chat.toggleClass("hide-" + name, !self.prop("checked")); - } }).find("input") .eq(0) .trigger("change");