title: Javascript pause event propagation
body: <p>I need to be able to chain click events, and temporarily pause event propagation between them.</p>
  
  <p>So, for a given element, it runs three different click events, but the second one needs user input, so it pauses propagation while the user fills in the form and then continues.</p>
  
  <pre><code>clickAction2 = -&gt;
    #Pause event propagation
    somehow.pauseEventPropegationRightHere()
  
    #Go and handle the dialogs, user input, JS requests
    goDoSomething().thenDoCallback( -&gt;
       #User is now authenticated completely.
       somehow.continueEventPropegationAsIfNothingHappened()
    )
  </code></pre>
  
  <p>In an effort to allow single responsibility, and events chained higher/lower shouldn't have knowledge that the event propagation was paused and nothing should be called twice.</p>
  
  <p><strong>No, the three click events can't be called sequentially from another function or any similar primitive solution.</strong></p>
  
  <p>This is in relation to AngularJS directives, but the solution does not need to rely on it.</p>
  
  <p>There is a similar question but none of the answers are satisfactory: <a href="https://stackoverflow.com/questions/7811959/how-to-continue-event-propagation-after-cancelling">How to continue event propagation after cancelling?</a>.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>What I need is a cleaner way to call <code>e.stopImmediatePropagation()</code>, and then continue from that point. As of right now, my best option is by manually entering the jQuery "private' data[1] and calling the functions manually.</p>
  
  <ol>
  <li><code>$._data( $(element)[0], 'events' ).click[].handler()</code></li>
  </ol>