             $confirmContainer.popover 'hide'
 
       $confirmContainer.on 'click', '.popover-content .cancel', ->
-        $confirmContainer.popover 'hide'
+        $confirmContainer.find('.popover').remove()
+        # $confirmContainer.popover 'hide'
 
       $confirmContainer.popover
         content: $html



pt.tags.push
  confirmDelete:
    event: 'click'
    callback: ->


confirm = ($el, type = 'confirm') ->
    attr = $el.ptAttr()

    switch type
      when 'delete'
        buttonName = attr.confirmButton or 'Delete'
        ajaxType = 'DELETE'
        url  = attr.confirmDelete
      when 'post'
        buttonName = attr.confirmButton or 'Save'
        ajaxType = 'POST'
        url  = attr.confirmPost
      else
        buttonName = attr.confirmButton or 'Yes'
        ajaxType = 'PUT'
        url = attr.confirm

    if attr.confirmContainer
      $confirmContainer = $el.closest(attr.confirmContainer)
