studio - alerts: refactored some alert and notification show/hide js added back to base.js
This commit is contained in:
@@ -48,17 +48,9 @@ $(document).ready(function () {
|
||||
(e).preventDefault();
|
||||
});
|
||||
|
||||
// alerts - manual close
|
||||
$('.action-alert-close, .alert.has-actions .nav-actions a').click(function(e) {
|
||||
(e).preventDefault();
|
||||
$(this).closest('.wrapper-alert').removeClass('is-shown');
|
||||
});
|
||||
|
||||
// notifications - manual & action-based close
|
||||
$('.action-notification-close').click(function(e) {
|
||||
(e).preventDefault();
|
||||
$(this).closest('.wrapper-notification').removeClass('is-shown').addClass('is-hiding');
|
||||
});
|
||||
// alerts/notifications - manual close
|
||||
$('.action-alert-close, .alert.has-actions .nav-actions a').bind('click', hideAlert);
|
||||
$('.action-notification-close').bind('click', hideNotification);
|
||||
|
||||
// nav - dropdown related
|
||||
$body.click(function (e) {
|
||||
@@ -550,6 +542,17 @@ function removeDateSetter(e) {
|
||||
$block.find('.time').val('');
|
||||
}
|
||||
|
||||
|
||||
function hideNotification(e) {
|
||||
(e).preventDefault();
|
||||
$(this).closest('.wrapper-notification').removeClass('is-shown').addClass('is-hiding');
|
||||
}
|
||||
|
||||
function hideAlert(e) {
|
||||
(e).preventDefault();
|
||||
$(this).closest('.wrapper-alert').removeClass('is-shown');
|
||||
}
|
||||
|
||||
function showToastMessage(message, $button, lifespan) {
|
||||
var $toast = $('<div class="toast-notification"></div>');
|
||||
var $closeBtn = $('<a href="#" class="close-button">×</a>');
|
||||
|
||||
Reference in New Issue
Block a user