Fix checkbox glitchiness (Issue#21)

This commit is contained in:
calzoneman 2013-04-02 11:16:26 -05:00
parent c175f461d1
commit 2ee182eb48
1 changed files with 6 additions and 1 deletions

View File

@ -702,7 +702,12 @@ function updateChatFilters(entries) {
remove.click(remcallback);
var actcallback = (function(filter) { return function() {
filter[2] = active.prop("checked");
// Apparently when you check a checkbox, its value is changed
// before this callback. When you uncheck it, its value is not
// changed before this callback
// [](/amgic)
var enabled = active.prop("checked");
filter[2] = (filter[2] == enabled) ? !enabled : enabled;
socket.emit("chatFilter", {
cmd: "update",
filter: filter