From f6cd4aac9a8ea96df0c41618c3a83a0c8097acc4 Mon Sep 17 00:00:00 2001 From: Julie Lala Date: Sat, 20 Dec 2014 22:29:09 -0500 Subject: making more things textareas --- js/tool.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'js/tool.js') diff --git a/js/tool.js b/js/tool.js index 190f29f..d3d40c1 100644 --- a/js/tool.js +++ b/js/tool.js @@ -21,4 +21,14 @@ var Tool = Model({ }) var Checkbox = Tool.extend({ + init: function (span){ + this.__init(span) + var state = this.name[0] == "x" + this.name = this.name.replace(/^[x_] /,"") + this.update(state) + }, + update: function(state){ + if (state) this.el.innerHTML = "x " + this.name + else this.el.innerHTML = "_ " + this.name + } }) -- cgit v1.2.3-70-g09d2