mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-05 22:44:22 +08:00
Fix hiding of error messages in the samples datatable [SCI-853]
This commit is contained in:
parent
1b56e9d07c
commit
0fd7688427
2 changed files with 11 additions and 13 deletions
|
@ -501,13 +501,11 @@ function onClickSave() {
|
|||
data: data,
|
||||
success: function (data) {
|
||||
sampleAlertMsg(data.flash, "success");
|
||||
HelperModule.hideFlashMsg();
|
||||
onClickCancel();
|
||||
},
|
||||
error: function (e, eData, status, xhr) {
|
||||
var data = e.responseJSON;
|
||||
clearAllErrors();
|
||||
sampleAlertMsgHide();
|
||||
|
||||
if (e.status == 404) {
|
||||
sampleAlertMsg(I18n.t("samples.js.not_found_error"), "danger");
|
||||
|
|
|
@ -56,28 +56,28 @@ function updateSamplesTypesandGroups() {
|
|||
}
|
||||
|
||||
function sampleAlertMsg(message, type) {
|
||||
var alertType, glyphSign;
|
||||
if (type == 'success') {
|
||||
var alertType;
|
||||
var glyphSign;
|
||||
if (type === 'success') {
|
||||
alertType = ' alert-success ';
|
||||
glyphSign = ' glyphicon-ok-sign ';
|
||||
} else if (type == 'danger') {
|
||||
} else if (type === 'danger') {
|
||||
alertType = ' alert-danger ';
|
||||
glyphSign = ' glyphicon-exclamation-sign ';
|
||||
}
|
||||
var htmlSnippet = '<div class="alert' + alertType + 'alert-dismissable alert-floating">' +
|
||||
var htmlSnippet = '<div class="alert alert' + alertType +
|
||||
'alert-dismissable alert-floating">' +
|
||||
'<div class="container">' +
|
||||
'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>' +
|
||||
'<button type="button" class="close" ' +
|
||||
'data-dismiss="alert" aria-label="Close">' +
|
||||
'<span aria-hidden="true">×</span></button>' +
|
||||
'<span class="glyphicon' + glyphSign + '"></span>' +
|
||||
'<span>'+ message +'</span>' +
|
||||
'<span>' + message + '</span>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
$('#notifications').html(htmlSnippet);
|
||||
$('#content-wrapper').addClass('alert-shown');
|
||||
}
|
||||
|
||||
function sampleAlertMsgHide() {
|
||||
$('#notifications').html('<div></div>');
|
||||
$('#content-wrapper').removeClass('alert-shown');
|
||||
HelperModule.hideFlashMsg();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue