Created
May 19, 2014 01:34
-
-
Save ddonovan/fd2dfd3067b7488a1f83 to your computer and use it in GitHub Desktop.
sample multi part gist for demo
This file contains hidden or 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
$( ".delete-confirm" ).on('click', function(e) { | |
var input = $(this); | |
var form = input.next(); | |
e.preventDefault(); | |
bsconfirm.confirm(function(confirmed){ | |
if(confirmed){ | |
form.submit(); | |
} | |
}); | |
}); | |
var bsconfirm = { | |
confirm:function(callback){ | |
var confirmed = false; | |
$("#myModal .modal-dialog .modal-content .modal-footer .btn-danger").on('click', function(e) { | |
confirmed = true; | |
$('#myModal').modal('hide'); | |
}); | |
$('#myModal').on('hidden.bs.modal', function (e) { | |
$('#myModal').off(); | |
if (typeof callback == "function") callback(confirmed); | |
}) | |
$('#myModal').modal('show'); | |
} | |
} |
This file contains hidden or 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
<a class="btn btn-danger btn-xs delete-confirm" role="button" data-route="{{route('employees.destroy',$employee->id)}}">Delete</a> | |
{{Form::open(['method'=>'delete', 'route'=>['employees.destroy',$employee->id],'class'=>''])}} | |
{{Form::close()}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment