IfnotFr / PopConfirm

A simple action confirmation plugin for jQuery based on Twitter Bootstrap Popover
MIT License
99 stars 35 forks source link

Allow destroying the popover #36

Open atxulo opened 8 years ago

atxulo commented 8 years ago

@twbs popover has a 'destroy' method that it's very useful when you're reusing a button.

For example, i use the same modal to do different operations, some require confirmation, but others don't, and i need to destroy the tooltip whenever the operation has not confirmation, and rebuild it when it does.

IfnotFr commented 8 years ago

Hi !

Do you mean destroy the handler before the popconfirm creation or destroy a already opened popconfirm ?

atxulo commented 8 years ago

I use the same button so i've to deal with these situations (think that the button is hidden and the popconfirm is not visible)

I mean destroy the handler, but whenever i want to destroy it, not only before the popconfirm creation.

IfnotFr commented 8 years ago

I think it will be complicated to allow a destroy as the action can be a link, a js event, a jquery event etc ... And for destroying popconfirm we have to restore the original event :(

atxulo commented 8 years ago

For me it'd be ok if the destroy method doesn't restore the original action and i have to reattach the click handler.

As i don't have s destroy method yet, i have to remove the button and recreate it with its handler.

El 14/10/2016 16:34, "Favre Anael" notifications@github.com escribió:

I think it will be complicated to allow a destroy as the action can be a link, a js event, a jquery event etc ... And for destroying popconfirm we have to restore the original event :(

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Ifnot/PopConfirm/issues/36#issuecomment-253817791, or mute the thread https://github.com/notifications/unsubscribe-auth/AGTAHQzMEiwYIIkFLBWnsugikSpLSsTcks5qz5MQgaJpZM4KPrrq .