Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
jquery_ujs async confirm
$ ->
$.rails.confirm = (message) ->
answer = $.Deferred();
modal = $ """
<div class="modal hide fade">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Delete</h3>
</div>
<div class="modal-body">
<p>#{message}</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
<a href="#" class="btn btn-primary">Delete</a>
</div>
</div>
"""
modal.on 'click', 'a.btn-primary', (event) ->
event.preventDefault()
answer.resolve()
modal.on 'hidden', ->
answer.reject()
modal.modal()
answer.promise()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.