Commit 11bba304 by Kang Donghun

add test log

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