Allow flash messages to appear a second time
This commit is contained in:
@ -40,10 +40,16 @@ $( document ).on('turbolinks:load', function() {
|
||||
container.animation = setTimeout(hide, DURATION);
|
||||
}
|
||||
|
||||
button.on('click', function () {
|
||||
// This will be fired by Bootstrap automatically
|
||||
container.on('close.bs.alert', function (e) {
|
||||
// Did the user click on the on the button to close?
|
||||
if (e.target instanceof Element || e.target instanceof HTMLElement) {
|
||||
clearTimeout(container.animation);
|
||||
hide();
|
||||
});
|
||||
}
|
||||
// We need to stop event propagation here. Otherwise, Bootstrap would remove the DOM element
|
||||
e.preventDefault();
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user