Created
July 18, 2012 12:08
-
-
Save stevenbristol/3135811 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.rails.showConfirmDialog = (link) -> | |
message = link.attr 'data-confirm' | |
html = """ | |
<div class="modal" id="confirmationDialog"> | |
<div class="modal-header"> | |
<a class="close" data-dismiss="modal">×</a> | |
<h3>#{message}</h3> | |
</div> | |
<div class="modal-body"> | |
<p>Are you sure you want to delete?</p> | |
</div> | |
<div class="modal-footer"> | |
<a data-dismiss="modal" class="btn">Cancel</a> | |
<a data-dismiss="modal" class="btn btn-primary confirm">OK</a> | |
</div> | |
</div> | |
""" | |
$(html).modal() | |
$('#confirmationDialog .confirm').on 'click', -> $.rails.confirmed(link) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment