Closed gdlx closed 11 years ago
Rails calls $.rails.allowAction for that, so you could just call $.rails.allowAction(element).
Ok but that means that I need an element with a confirm
data attribute, which is not my actual case (and creating a hidden element just for the confirm call is not really clean...)
I understand that you've overridden the allowAction
function but shouldn't you have overridden the root $.rails.confirm
function so that all rails confirm calls are catched? (you currently only catch action confirmations)
Additionally, it seems that you've just catched the click
action...but I've no click action at all...just an ajax callback...
I tried to override $.rails.confirm
but it doesn't seems to be possible to it in a clean way with the same behavior (bool return, no callback) because JS execution is not suspended while confirm box is displayed...
More a question than an issue : is there a way to send a static call to confirm function with your override features enabled ?
I mean, I need to call confirm after an ajax response but if I just call
confirm
or even$.rails.confirm
(I thought your gem was overriding it), I get browser's basic confirm box.I know I could call
TwitterBootstrapConfirmBox
explicitely but I don't want my ajax function to depend on a specific gem. So it should call a "standard" conrifm function, and use yours if present.Thanks !