Gid rid of toast message.
This commit is contained in:
@@ -319,9 +319,6 @@ function saveSubsection() {
|
||||
success: function() {
|
||||
$spinner.delay(500).fadeOut(150);
|
||||
$changedInput = null;
|
||||
},
|
||||
error: function() {
|
||||
showToastMessage(gettext('There has been an error while saving your changes.'));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -497,40 +494,6 @@ function hideAlert(e) {
|
||||
$(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>');
|
||||
$toast.append($closeBtn);
|
||||
var $content = $('<div class="notification-content"></div>');
|
||||
$content.html(message);
|
||||
$toast.append($content);
|
||||
if ($button) {
|
||||
$button.addClass('action-button');
|
||||
$button.bind('click', hideToastMessage);
|
||||
$content.append($button);
|
||||
}
|
||||
$closeBtn.bind('click', hideToastMessage);
|
||||
|
||||
if ($('.toast-notification')[0]) {
|
||||
var targetY = $('.toast-notification').offset().top + $('.toast-notification').outerHeight();
|
||||
$toast.css('top', (targetY + 10) + 'px');
|
||||
}
|
||||
|
||||
$body.prepend($toast);
|
||||
$toast.fadeIn(200);
|
||||
|
||||
if (lifespan) {
|
||||
$toast.timer = setTimeout(function() {
|
||||
$toast.fadeOut(300);
|
||||
}, lifespan * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
function hideToastMessage(e) {
|
||||
e.preventDefault();
|
||||
$(this).closest('.toast-notification').remove();
|
||||
}
|
||||
|
||||
function addNewSection(e, isTemplate) {
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user