# ----------------------------------------------------------------------------- # INPUT CHECKBOX # ----------------------------------------------------------------------------- class @InputCheckbox extends InputString _safeValue: -> if not @value or @value == 'false' or @value == 0 or @value == '0' return false else return true _addInput: -> # NOTE: for boolean checkbox to be serialized correctly we need a hidden false # value which is used by default and overriden by checked value @$false_hidden_input =$ "" @$el.append @$false_hidden_input @$input =$ "" @$el.append @$input # # PUBLIC # constructor: (@name, @value, @config, @object) -> @$el =$ "