Commit bb9305e1 by NGO THI HONG

Change function displayAlert -> showAlert

parent 3f96c2a0
......@@ -162,29 +162,6 @@ COMMON.showAlert = function (messageCode, options = {}) {
};
/**
* show alert
*
* @param {String} msgCode
*/
COMMON.displayAlert = function (msgCode, isError) {
$('#msgModel').html(I18N.i18nText(msgCode));
$('#confirmYes').hide();
$('#confirmNo').text(I18N.i18nText("confirmation"));
if (isError) {
$('#modalTitle').text(I18N.i18nText("error"));
}
// $('.alert-overlay').removeClass('d-none');
// $('.alert-area').removeClass('d-none');
// const positionY = $(document).scrollTop() + screen.height / 8;
// const height = screen.height / 4;
// $('.alert-overlay').css('height', screen.height);
// $('.alert-area').css('top', positionY);
// $('.alert-area').css('min-height', height);
// $('body').css('overflow', 'hidden');
};
/**
* close alert
*/
COMMON.alertClose = function () {
......@@ -282,10 +259,10 @@ COMMON.cmsAjax = function (url, param, async = true, callback, errorCallback, ty
COMMON.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN);
} else if (result.httpStatus == '403') {
COMMON.closeLoading();
COMMON.displayAlert('errorOccurred');
COMMON.showAlert('errorOccurred');
} else {
COMMON.closeLoading();
COMMON.displayAlert(result.message);
COMMON.showAlert(result.message);
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
......@@ -293,7 +270,7 @@ COMMON.cmsAjax = function (url, param, async = true, callback, errorCallback, ty
errorCallback(XMLHttpRequest, textStatus, errorThrown);
} else {
COMMON.closeLoading();
COMMON.displayAlert('errorCommunicationFailed');
COMMON.showAlert('errorCommunicationFailed');
}
},
});
......@@ -302,7 +279,7 @@ COMMON.cmsAjax = function (url, param, async = true, callback, errorCallback, ty
errorCallback();
} else {
COMMON.closeLoading();
COMMON.displayAlert('errorOccurred');
COMMON.showAlert('errorOccurred');
}
}
};
......
......@@ -66,17 +66,17 @@ HEADER.processLogout = function () {
COMMON.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN);
} else {
if (data.errorMessage) {
COMMON.displayAlert(data.errorMessage);
COMMON.showAlert(data.errorMessage);
} else {
COMMON.displayAlert('errorOccured');
COMMON.showAlert('errorOccured');
}
}
},
function (xmlHttpRequest, txtStatus, errorThrown) {
if (xmlHttpRequest.errorMessage) {
COMMON.displayAlert(xmlHttpRequest.errorMessage);
COMMON.showAlert(xmlHttpRequest.errorMessage);
} else {
COMMON.displayAlert('errorOccured');
COMMON.showAlert('errorOccured');
}
},
);
......
......@@ -460,7 +460,7 @@ OL.search = function () {
if (searchStartDate && searchEndDate && searchStartDate > searchEndDate) {
COMMON.closeLoading();
COMMON.displayAlert('dateError');
COMMON.showAlert('dateError');
return;
}
......
......@@ -54,7 +54,7 @@ PP.initPdfList = function () {
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.QUICK_REPORT_PRINT;
$('#pdfPrintDiv').load(url, params);
} else {
COMMON.displayAlert('error');
COMMON.showAlert('error');
COMMON.avwScreenMove('reportList.html');
}
};
......@@ -431,7 +431,7 @@ PICKUP.createContinousWorkList = function (operationListOld) {
let ahrefRequiredFlg;
if (operationList[i].permitCodeRequiredFlg == 1) {
ahrefRequiredFlg = $("<a href=\"javascript:CHK.displayAlert('onlyRfid');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
ahrefRequiredFlg = $("<a href=\"javascript:COMMON.showAlert('onlyRfid');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
} else {
ahrefRequiredFlg = $(
'<a href="javascript:PICKUP.sendReportFormFromContinuousWork (\'' +
......
......@@ -81,12 +81,12 @@ RL.checkQuickReport = function () {
RL.isQuickReport = result.isQuickReport;
},
function () {
COMMON.displayAlert('msgOperationEmpty');
COMMON.showAlert('msgOperationEmpty');
COMMON.avwScreenMove('index.html');
},
);
} else {
COMMON.displayAlert('error');
COMMON.showAlert('error');
COMMON.avwScreenMove('index.html');
}
};
......@@ -104,7 +104,7 @@ RL.initTaskReportList = function () {
COMMON.closeLoading();
});
} else {
COMMON.displayAlert('error');
COMMON.showAlert('error');
COMMON.avwScreenMove('index.html');
}
};
......
......@@ -28,14 +28,14 @@ SETTINGS.getToken = function () {
if (data.token) {
$('#getToken').val(data.token);
} else {
COMMON.displayAlert("token error..", true);
COMMON.showAlert("token error..", true);
}
},
function(data) {
if (data.errorMessage) {
COMMON.displayAlert(data.errorMessage);
COMMON.showAlert(data.errorMessage);
} else {
COMMON.displayAlert('msgPwdChangeNG');
COMMON.showAlert('msgPwdChangeNG');
}
});
};
......@@ -134,7 +134,7 @@ SETTINGS.avwCmsApi_passwordChange_success = function (data) {
$('#txtPwdNew').val('');
$('#txtPwdNewRe').val('');
/* show messages */
COMMON.displayAlert('msgPwdChangeOK');
COMMON.showAlert('msgPwdChangeOK');
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment