add rails flash messages that dismiss after 5 seconds

This commit is contained in:
Zachary Chai
2017-03-14 14:16:14 -04:00
parent b0512a0569
commit b2031c97a3
4 changed files with 21 additions and 3 deletions

View File

@ -51,6 +51,13 @@ var showAlert = function(html, timeout_delay) {
}
};
// remove flash alerts after 5 seconds
var flashAlertDelayedDismiss = function() {
setTimeout(function(){
$('.flash-alerts').remove();
}, 5000);
};
var displayRoomURL = function() {
$('.meeting-url').val(Meeting.getInstance().getURL());
};
@ -78,4 +85,5 @@ $(document).on("turbolinks:load", function() {
if (isRoomOwner()) {
Notification.requestPermission();
}
flashAlertDelayedDismiss();
});