app/assets/javascripts/chr/form/input-text.coffee in chr-0.2.1 vs app/assets/javascripts/chr/form/input-text.coffee in chr-0.2.4

- old
+ new

@@ -1,23 +1,40 @@ # ----------------------------------------------------------------------------- +# Author: Alexander Kravets <alex@slatestudio.com>, +# Slate Studio (http://www.slatestudio.com) +# +# Coding Guide: +# https://github.com/thoughtbot/guides/tree/master/style/coffeescript +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- # INPUT TEXT +# ----------------------------------------------------------------------------- +# # Dependencies: -# - jquery.textaread_autosize.js (https://github.com/javierjulio/textarea-autosize) -# - bugfix: https://github.com/javierjulio/textarea-autosize/issues/8#issuecomment-67300688 +#= require ../vendor/jquery.scrollparent +#= require ../vendor/jquery.textarea_autosize +# # ----------------------------------------------------------------------------- class @InputText extends InputString - _addInput: -> - @$input =$ "<textarea class='autosize' name='#{ @name }' id='#{ @name }' rows=1>#{ @_valueSafe() }</textarea>" + + # PRIVATE =============================================== + + _add_input: -> + @$input =$ "<textarea class='autosize' name='#{ @name }' rows=1>#{ @_safe_value() }</textarea>" @$el.append @$input + + # PUBLIC ================================================ + initialize: -> # TODO: refactor a bit plugin code so there is no blink while jumping from object to object @$input.textareaAutoSize() @config.onInitialize?(this) -_chrFormInputs['text'] = InputText +chr.formInputs['text'] = InputText