Commit 11bba304 by Kang Donghun

add test log

parent 69b41b43
......@@ -46,6 +46,7 @@ $(document).ready(function() {
* @param {*} url
*/
COMMON.avwScreenMove = function (url) {
console.log("kdh check avwScreenMove url : " + url);
COMMON.showLoading();
window.onbeforeunload = null;
window.location = url;
......@@ -59,7 +60,7 @@ COMMON.avwScreenMove = function (url) {
*/
COMMON.showLoading = function () {
console.log("kdh check showLoading");
$('#loader').css( {
$('#loader').css({
'width': $(window).width(),
'height': $(window).height()
});
......@@ -70,6 +71,7 @@ COMMON.showLoading = function () {
* close loading
*/
COMMON.closeLoading = function () {
console.log("kdh check closeLoading");
setTimeout(function(){
document.getElementById('loader').style.display = 'none';
}, 1000);
......@@ -122,7 +124,7 @@ COMMON.showConfirmModal = function (data, confirmCallback) {
* Show confirm modal with defaults: title, yes, no
* @param {string} messageCode
* @param {callback} confirmCallback - The callback that handles the confirm button clicked
* @param {Object} options - Object with {titleCode, message, confirmYesCode, confirmNoCode}
* @param {Object} options - Object with {title, message, confirmYes, confirmNo}
*/
COMMON.showConfirm = function (messageCode, confirmCallback, options = {}) {
const defaultParams = {
......@@ -130,28 +132,16 @@ COMMON.showConfirm = function (messageCode, confirmCallback, options = {}) {
confirmYesCode: 'confirmYes',
confirmNoCode: 'confirmNo'
}
const params = Object.assign(defaultParams, options);
const params = Object.assign(options, defaultParams);
let message = '';
if (messageCode) {
message = I18N.i18nText(messageCode);
if (typeof message === 'undefined') {
//lang of messageCode undefined, use message or messageCode
if (params.message) {
message = params.message;
} else {
message = messageCode;
}
}
} else if (params.message) {
message = params.message;
}
let title = I18N.i18nText(params.titleCode);
if (params.title) {
title = params.title;
}
COMMON.showConfirmModal({
message: message,
title: title,
title: I18N.i18nText(params.titleCode),
confirmYes: I18N.i18nText(params.confirmYesCode),
confirmNo: I18N.i18nText(params.confirmNoCode)
}, confirmCallback);
......@@ -166,11 +156,23 @@ COMMON.showConfirm = function (messageCode, confirmCallback, options = {}) {
COMMON.showAlert = function (messageCode, titleCode = 'error', options = {}) {
const defaultParams = {
titleCode: titleCode ? titleCode : 'error',
confirmYesCode: null,
confirmNoCode: 'close',
confirmNoCode: 'close'
}
const params = Object.assign(defaultParams, options);
COMMON.showConfirm(messageCode, null, params);
const params = Object.assign(options, defaultParams);
let message = '';
if (messageCode) {
message = I18N.i18nText(messageCode);
if (typeof message === 'undefined') {
message = messageCode;
}
} else if (params.message) {
message = params.message;
}
COMMON.showConfirmModal({
message: message,
title: I18N.i18nText(params.titleCode),
confirmNo: I18N.i18nText(params.confirmNoCode)
});
};
/**
......
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