diff --git a/utils.js b/utils.js index d51a7a8..6ffa165 100644 --- a/utils.js +++ b/utils.js @@ -235,11 +235,13 @@ class BinaryInputBuilder { let input = new ElementBuilder("input#" + this.key) .type("checkbox") .checked(this.result[this.key]) - .if(this.update_handler !== null, b => b.on_click(e => { + .on_click(e => { console.log(e.target.checked); this.result[this.key] = e.target.checked; - this.update_handler(e.target.checked); - })) + if(this.update_handler !== null) { + this.update_handler(e.target.checked); + } + }) .finish(); let bundle = new ElementBuilder("div.horizontal-list")