title: Bootstrap modal popover hide on close
body: <p>I have a modal that when trying to run will activate a popover for validation. I've added a timeout to popover to hide after 3 seconds. But if you close the modal the timeout features seems to stop, the popover doesn't hide and even directly telling it to hide doesn't work.</p>
  
  <p><strong>Modal html</strong></p>
  
  <pre><code>&lt;div class="modal hide fade" id ="password_modal"&gt;
      &lt;div class="modal-header"&gt;
          &lt;h3&gt;Change Password &lt;span class="extra-title muted"&gt;&lt;/span&gt;&lt;/h3&gt;
      &lt;/div&gt;
      &lt;div class="modal-body form-horizontal"&gt;
          &lt;div class="control-group"&gt;
              &lt;label for="current_password" class="control-label"&gt;Current Password&lt;/label&gt;
              &lt;div class="controls"&gt;
                  &lt;input type="password" name="current_password"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="control-group"&gt;
              &lt;label for="new_password" class="control-label"&gt;New Password&lt;/label&gt;
              &lt;div class="controls"&gt;
                  &lt;input type="password" name="new_password"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="control-group"&gt;
              &lt;label for="confirm_password" class="control-label"&gt;Confirm Password&lt;/label&gt;
              &lt;div class="controls"&gt;
                  &lt;input type="password" name="confirm_password"&gt;
              &lt;/div&gt;
          &lt;/div&gt;      
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
          &lt;button href="#" class="btn" data-dismiss="modal" aria-hidden="true"&gt;Close&lt;/button&gt;
          &lt;button href="#" class="btn btn-primary" id="password_modal_save"&gt;Save changes&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Inside the modal</strong></p>
  
  <pre><code>options = {
      content: raw_data.errors,
      html: true,
      placement: 'top',
      trigger: 'manual'
  }
  $('#password_modal_save').popover(options);
  $('#password_modal_save').popover('show');
  setTimeout(function(){ click.popover('hide'); }, 3000);
  </code></pre>
  
  <p><strong>Modal close listener</strong></p>
  
  <pre><code>$("body").on("hidden", "#password_modal", function(event){
      $(this).remove(); //Remove the modal to stop duplications
      $('#password_modal_save').popover('hide'); //Targetting the popover directly
      $('.popover').remove(); //Last solution to actually hiding it
  });
  </code></pre>
  
  <p>I'm hoping for a cleaner way to hide the popover other than <code>$('.popover').remove();</code></p>
  
  <p>Fiddle: <a href="http://jsfiddle.net/La2yn/20/" rel="nofollow">http://jsfiddle.net/La2yn/20/</a></p>