mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 12:33:07 +00:00
Clean up redundant code
This commit is contained in:
parent
cb1effa375
commit
8fe9f86423
1 changed files with 3 additions and 19 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue