title: How to trigger best_in_place events
body: <p>I've looked all over Google and StackOverflow and looked through the best_in_place javascript code to no avail.</p>
  
  <p>I am using best_in_place to edit a property of a <code>Post</code> model by using a textarea, like so:</p>
  
  <pre class="lang-rb prettyprint-override"><code>&lt;%= best_in_place @post, :summary, 
                   { :type =&gt; :textarea, :display_with =&gt; 'simple_format'}  %&gt;
  </code></pre>
  
  <p>I want to be able to trigger best_in_place's submit function(s) when hitting Enter/Return unless it's pressed with the shift key (which would allow a carriage return), just as it would when clicking outside of the editable area. With a regular text/input, this is default functionality (minus the carriage return part). However when using textareas, it is not.</p>
  
  <p>I've got a nice piece of jQuery pulled from <a href="https://stackoverflow.com/questions/18779322/disable-new-line-in-textarea-when-pressed-enter">here</a> that handles identifying when Enter with/without shift is pressed, but I can't figure out how to trigger best_in_place to submit the data.</p>
  
  <pre class="lang-js prettyprint-override"><code>//Have to bind it to the activate function, or else 
  //the element won't be in the DOM when it tries to identify it
  $('.best_in_place').bind('best_in_place:activate', function(){          
     $(this).find('textarea').keyup(function(e) {
        var $textarea = $(this);
        if(e.keyCode == 13 &amp;&amp; !e.shiftKey) {
          e.preventDefault(); // Don't make a new line         
          // This line does weird things
         $(this).parents('.best_in_place').trigger('best_in_place:update').trigger('best_in_place:deactivate');
        }
      });
  });
  </code></pre>
  
  <p>I also have some functions bound to the <code>best_in_place:update</code> function, which basically add &amp; remove classes for styling. With the above code, when I hit enter within a best_in_place textarea, the functions that I have bound to the <code>best_in_place:update</code> function fire, but no data is submitted to the server, as I can see in the console. </p>
  
  <p><strong>TL;DR;</strong> How can I trigger best_in_place to submit/update and deactivate on hitting the Enter key, just as it would when clicking outside the editable area?</p>