bluerail / twitter-bootstrap-rails-confirm

Confirm dialogs using Twitter Bootstrap
https://bluerail.nl
MIT License
85 stars 34 forks source link

Doesnt work if :method => :delete not present #1

Closed deneuxa closed 11 years ago

deneuxa commented 12 years ago

isn't it possible to make a confirm link like this ?

=link_to "foo_text", :foo, :confirm => "foo_confirm_text"

The modal box is rendered: Clicking Cancel hide the modal Clicking OK reload the origin page and not the destination of the url...

Thanks

rvanlieshout commented 11 years ago

jQuery's methods of triggering events behave different than real native events; thus not triggering the expected window.location change.

Efforts have been made in plugins to support native events (like http://johnkpaul.github.com/jquery-simulate/jquery.simulate.js), but triggering the event and changing the $.rails.allowAction after it doesn't seem to go smoothly. More investigation is needed here...

A short answer: Not being able to use native events forces us here to bind a custom method to the click event of this link changing window.location.

rvanlieshout commented 11 years ago

This will be fixed when jQuery provides support for triggering native events properly

rvanlieshout commented 11 years ago

This won't get solved by waiting for jQuery to make this happen...

rvanlieshout commented 11 years ago

Used a new method for dispatching events in master. Could you try this version?

rvanlieshout commented 11 years ago

Released 1.0.0 for this one