Skip to content

Instantly share code, notes, and snippets.

View zonaro's full-sized avatar
🎤
Beatbox & Code

Kaizonaro zonaro

🎤
Beatbox & Code
View GitHub Profile
@jnormore
jnormore / bootstrap3-alert-box.js
Last active November 10, 2019 13:07
Bootstrap 3 alert and confirm modals. Overrides window.alert normally, but window.confirm override requires a callback function to be passed to get result. Optional arguments for modal title and confirm button label.
window.alert = function(message, title) {
if($("#bootstrap-alert-box-modal").length == 0) {
$("body").append('<div id="bootstrap-alert-box-modal" class="modal fade">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header" style="min-height:40px;">\
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>\
<h4 class="modal-title"></h4>\
</div>\
<div class="modal-body"><p></p></div>\