view app/assets/javascripts/zp.new.js @ 233:5921c0dea632

Update gems.
author Edho Arief <edho@myconan.net>
date Sat, 25 May 2013 12:16:41 +0900
parents cbd5819d7468
children 45bd94c70896
line wrap: on
line source

//= require jquery.autosize
//= require autosize-box-fix
(function($) {
  window.zp.new = {
    input: function() { return $("#paste_paste") },
    clear: function(e) {
      this.input().val("").focus()
      e.preventDefault()
    },
    init: function() {
      if (this.input().length === 0) { return }
      $(document).on('click', "#reset_paste", $.proxy(this.clear, this))
      this.input().autosize({ className: 'mirrored_text row-fluid', append: "\n"});
      $.autosize_box_fix($(".mirrored_text"))
      this.input().focus()
    }
  }
})(jQuery)