Created
January 15, 2014 05:23
-
-
Save lnickers2004/8431262 to your computer and use it in GitHub Desktop.
Bootstrap3: ALERT closing and resetting when a dialog is closed, followed by closing the confirmation alert
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
<script> | |
(function() | |
{ | |
$sentDialog.on("hidden.bs.modal", function () { | |
//do some work, save form, move onto another page etc | |
//show the Alert | |
$("#sentAlert").show(); | |
}); | |
var $sentAlert = $("#sentAlert"); | |
//handle the getting ready to close event ... | |
//careful don't handle closed.bs.alert because that fires after dom removal | |
$sentAlert.on("close.bs.alert", function () { | |
$sentAlert.hide();//hide it only | |
return false;//don't remove it from the DOM in cases where we wish to reuse the alert over and over | |
}); | |
})(); | |
</script> | |
<!-- HERE IS THE ALERT ONLY SEE OTHER GIST FOR DIALOG--> | |
<div class="alert alert-warning collapse" id="sentAlert"> | |
<a href="#" data-dismiss="alert" class="close">×</a> | |
<p>This doesn't work. Its not real!</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment