summaryrefslogtreecommitdiffstats
path: root/web/widget/checkbox.js
blob: b31f29a524cfbfc7339536788a4424ae0607f730 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Copyright (c) 2012-2014 Kaarle Ritvanen
 * See LICENSE file for license details
 */

define(["aconf/widget/field", "jquery"], function(Base, $) {
    return Base.extend({
	staticRender: function(value, meta) {
	    return $("<td>").text(value ? "Yes" : "No");
	},

	statusEl: function() { return this.el.parent(); },

	render: function(value, meta) {
	    this.field.attr({type: "checkbox", checked: value});
	},

	get: function() { return this.field.is(":checked"); }
    });
});