title: How to toggle edit-in-place functionality in jQuery?
body: <p>I've been playing around with <a href="http://code.google.com/p/jquery-in-place-editor/" rel="nofollow">jQuery In Place Editor</a> and I can't figure out how to properly disable it. Below is the code I have so far.</p>
  
  <p>I'm using jQuery <code>toggle</code> method to initialize and terminate the plugin functionality on a list of links. There are some extra bits in the code below which are probably not related to my issue but I left them there just in case.</p>
  
  <p>The problem is that the code below works as I expect on first 2 clicks (i.e. 1st click - enable editInPlace plugin, 2nd click - disable it) but <strong>it doesn't re-enable edit in place functionality on 3rd click</strong>.</p>
  
  <p>Any ideas why?</p>
  
  <pre><code>(shoppingList.editButton).toggle(function() {
              (shoppingList.editButton).attr('value', 'Finish editing');
              (shoppingList.$ingrLinks).unbind('click', shoppingList.ingredients) // disable some functionality on links
                                       .addClass('inplace-editor') // add class to links I want to be editable
                                       .removeAttr('href') // make links unclickable
                                       .editInPlace({ // editInPlace plugin initialized
                                           url: 'http://localhost:8000/edit-ingredient/',
                                           show_buttons: true
                                       });
  
          }, function() {
              (shoppingList.editButton).attr('value', 'Edit items');
              (shoppingList.$ingrLinks).bind('click', shoppingList.ingredients) // bring back the functionality previously removed
                                       .removeClass('inplace-editor') // remove the class from links that were editable
                                       .attr('href', '#') // make the links clickable again
                                       .unbind('.editInPlace') // remove editInPlace plugin functionality
                                       ;
          });
  </code></pre>