# ----------------------------------------------------------------------------- # Author: Alexander Kravets , # Slate Studio (http://www.slatestudio.com) # # Coding Guide: # https://github.com/thoughtbot/guides/tree/master/style/coffeescript # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # INPUT INVERTER VERSION SELECT # ----------------------------------------------------------------------------- class @InputInverterVersion extends InputSelect _create_el: -> @config.optionsHashFieldName = '_document_versions' @config.ignoreOnSubmission = true @config.default = 0 @url = "#{ @config.path }/#{ @object._id }.json" @$el =$ "
" _add_input: -> @$input =$ """""" @$el.append @$input @$input.on 'change', (e) => @_load_version() @_add_options() _load_version: -> version = @$input.val() $.get @url, { version: version }, (object) -> chr.module.view.form.updateValues(object) chr.formInputs['inverter-version'] = InputInverterVersion