From: dsc Date: Sun, 26 Feb 2012 23:59:39 +0000 (-0800) Subject: Booleans now render as checkboxes, and objects/arrays/functions as textareas. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=7b11fd6d4d93fdb8aa19ee1d62b0426843ce2f83;p=limn-bak.git Booleans now render as checkboxes, and objects/arrays/functions as textareas. --- diff --git a/lib/template/graph-option.jade b/lib/template/graph-option.jade index 2c6755a..08695bd 100644 --- a/lib/template/graph-option.jade +++ b/lib/template/graph-option.jade @@ -20,7 +20,8 @@ include browser-helpers textarea.value(id=value_id, name=name, class=type_cls) #{value} else - var input_type = (/boolean/i.test(type) ? 'checkbox' : 'text'); - input.value(type=input_type, id=value_id, name=name, class=type_cls, value=value) + - var checked = ((/boolean/i.test(type) && value) ? 'checked' : null); + input.value(type=input_type, id=value_id, name=name, class=type_cls, value=value, checked=checked) .type(class=type_cls) #{type} .default(class=type_cls, title="Default: #{def} (#{type})") #{def}