bluerail / twitter-bootstrap-rails-confirm

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

Doesn't work with older versions of jquery-rails #27

Closed Ajedi32 closed 8 years ago

Ajedi32 commented 9 years ago

I am in the process of upgrading my application from Bootstrap 2 to Bootstrap 3. After updating, I discovered the version of twitter-bootstrap-rails-confirm I had installed no longer worked correctly with the new version of Bootstrap (which I expected to happen, no problems there).

After updating twitter-bootstrap-rails-confirm from 1.0.1 to 1.0.4 though, the gem no longer worked at all. When clicking on buttons which required confirmation in my app, I received no confirmation message (the link target would just be navigated to with a get request) and the following error appeared in the console:

Uncaught Error: Syntax error, unrecognized expression: <div class="modal" id="confirmation_dialog" role="dialog">        <div class="modal-dialog">          <div class="modal-content">            <div class="modal-header">              <button type="button" class="close" data-dismiss="modal">×</button>              <h4 class="modal-title">...</h4>            </div>            <div class="modal-body"></div>            <div class="modal-footer"></div>          </div>        </div>      </div>

Sizzle.error                        jquery.js?body=1:4422
tokenize                            jquery.js?body=1:5077
select                              jquery.js?body=1:5461
Sizzle                              jquery.js?body=1:3999
jQuery.fn.extend.find               jquery.js?body=1:5577
jQuery.fn.jQuery.init               jquery.js?body=1:197
jQuery                              jquery.js?body=1:63
TwitterBootstrapConfirmBox          confirm.js?body=1:30
$.rails.allowAction                 confirm.js?body=1:74
(anonymous function)                jquery_ujs.js?body=1:303
jQuery.event.dispatch               jquery.js?body=1:3075
jQuery.event.add.elemData.handle    jquery.js?body=1:2751

Updating jquery-rails from 2.2.1 to 3.1.2 resolved the problem for me. I recommend you update the docs to indicate which versions of jquery are supported.

Ajedi32 commented 9 years ago

Or maybe this is an issue with Bootstrap itself? Not sure...

rvanlieshout commented 9 years ago

Hmm... could be. we'll have to test what jquery version triggers this error

rvanlieshout commented 8 years ago

Updated readme