view app/assets/javascripts/zp.new.js.coffee @ 351:66fd92af3977

coffee: new.
author edogawaconan <me@myconan.net>
date Thu, 03 Jul 2014 15:15:53 +0900
parents app/assets/javascripts/zp.new.js@3ce44f960d3a
children
line wrap: on
line source

#= require jquery.autosize
#= require autosize_box_fix
window.zp.new =
  input: -> $("#paste_paste")

  clear: (e) ->
    e.preventDefault()
    @input().val("").focus()

  init: ->
    return unless @input().length

    $(document).on "click", "#reset_paste", $.proxy(@clear, this)
    @input().autosize className: "mirrored_text form-control", append: "\n"
    $.autosize_box_fix $(".mirrored_text")
    @input().focus()