Commit 8f7b8434 by Kang Donghun

Add showLoading when init runs, delete unnecessary logs

parent e8e4cdb0
......@@ -43,6 +43,7 @@ COMMON.avwScreenMove = function (url) {
COMMON.showLoading();
window.onbeforeunload = null;
window.location = url;
COMMON.closeLoading();
};
/**
......@@ -52,7 +53,6 @@ COMMON.avwScreenMove = function (url) {
* @param {String} key
*/
COMMON.showLoading = function () {
console.log('kdh check showLoading');
$('#loader').css({
width: $(window).width(),
height: $(window).height(),
......@@ -301,7 +301,6 @@ COMMON.cmsAjax = function (url, param, async = true, callback, errorCallback, ty
*/
COMMON.checkAuth = function (async = true) {
let params = {};
console.log('kdh check');
params.sid = COMMON.getSid;
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.AUTH_SESSION;
COMMON.cmsAjax(url, params, async, null, function () {
......
......@@ -128,6 +128,7 @@ DASHBOARD.initHtmlItem = function (item) {
/** Initialization dashboard screen */
DASHBOARD.init = function () {
//Check if user is logged in
COMMON.showLoading();
COMMON.checkAuth(false);
sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.DASHBOARD;
......
......@@ -11,9 +11,9 @@ var PP = {};
*/
PP.init = function () {
//Check if user is logged in
COMMON.showLoading();
COMMON.checkAuth(false);
console.log('PP.init');
PP.loadCommon();
COMMON.closeLoading();
......
......@@ -133,10 +133,10 @@ PICKUP.getReportWithWarningsListData = function (callback) {
*/
PICKUP.init = function () {
//Check if user is logged in
COMMON.showLoading();
COMMON.checkAuth(false);
console.log('PICKUP.init');
sessionStorage.removeItem("pickUpType");
// sessionStorage.pickUpType = null;
sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.DASHBOARD;
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal('#includedConfirmModal');
......
......@@ -22,6 +22,7 @@ PushMessageDetail.dummyMessageDetailJson = {
* init when html loaded
*/
PushMessageDetail.init = function () {
COMMON.showLoading();
//Check if user is logged in
COMMON.checkAuth(false);
//load common html
......
......@@ -10,6 +10,7 @@ PushMessageList.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), Client
*/
PushMessageList.init = function () {
//Check if user is logged in
COMMON.showLoading();
COMMON.checkAuth(false);
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal();
......
......@@ -11,6 +11,7 @@ RF.addReportFlg;
* init
*/
RF.init = function () {
COMMON.showLoading();
//Check if user is logged in
COMMON.checkAuth(false);
COMMON.checkQuickReport(function (result) {
......
......@@ -14,21 +14,13 @@
RL.init = function () {
//Check if user is logged in
COMMON.showLoading();
console.log("kdh check closeLoading RL.init1");
COMMON.checkAuth(false);
console.log("kdh check closeLoading RL.init2");
console.log('ReportList init start');
console.log("kdh check closeLoading RL.init3");
COMMON.checkQuickReport(function(result) {
if (result) RL.isQuickReport = result.isQuickReport;
} );
console.log("kdh check closeLoading RL.init4");
RL.loadCommon();
console.log("kdh check closeLoading RL.init5");
RL.initTaskReportList();
console.log("kdh check closeLoading RL.init6");
COMMON.closeLoading();
console.log("kdh check closeLoading RL.init7");
};
/**
......@@ -75,33 +67,6 @@
}
/**
* check quick report
*/
// RL.checkQuickReport = function () {
// if (sessionStorage.getItem("operationId")) {
// let params = {};
// params.sid = COMMON.getSid();
// params.operationId = sessionStorage.getItem("operationId");
// let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.IS_QUICK_REPORT;
// COMMON.cmsAjax(
// url,
// params,
// false,
// function (result) {
// RL.isQuickReport = result.isQuickReport;
// },
// function () {
// COMMON.showAlert('msgOperationEmpty');
// COMMON.avwScreenMove('index.html');
// },
// );
// } else {
// COMMON.showAlert('error');
// COMMON.avwScreenMove('index.html');
// }
// };
/**
* init task report list
*/
RL.initTaskReportList = function () {
......@@ -111,7 +76,7 @@
params.operationId = sessionStorage.getItem("operationId");
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.TASK_REPORT_LIST;
$('#reportList').load(url, params, function () {
COMMON.closeLoading();
COMMON.closeLoading();
});
} else {
COMMON.showAlert('error');
......
......@@ -125,6 +125,7 @@ SendMessage.templateSelectedCallback = function (template) {
* init data, action when screen onload
*/
SendMessage.init = function () {
COMMON.showLoading();
//Check if user is logged in
COMMON.checkAuth(false);
TEMPLATE.loadHeader('#includedHeader');
......
......@@ -7,6 +7,7 @@ var SETTINGS = {};
// Init function of page
$(document).ready(function () {
COMMON.showLoading();
//Check if user is logged in
COMMON.checkAuth(false);
SETTINGS.getToken();
......
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