From 3cfc37b76eba90563ae7ec6f7b62b2c10210dffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Thu, 13 Dec 2018 00:46:03 +0900 Subject: [PATCH] Fix: hide company and subject panel by clicking subject button --- src/game/license_timer/input_score.js | 3 +++ src/game/license_timer/timer.js | 27 +++++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/game/license_timer/input_score.js b/src/game/license_timer/input_score.js index f6388d7..77d7311 100644 --- a/src/game/license_timer/input_score.js +++ b/src/game/license_timer/input_score.js @@ -268,6 +268,9 @@ InputScore.prototype.onClickCompanySubjectButton = function(subjectFullname) { // console.log(this.selectedSubjectData); this.timer.setStartTime(this.selectedSubjectData.timeLimit * Timer.TIME_SECONDS_FOR_MINUTE); + + this.setVisibleCompanyPanel(false); + this.setVisibleSubjectPanel(false, ""); } diff --git a/src/game/license_timer/timer.js b/src/game/license_timer/timer.js index 617c8a0..dbf53c8 100644 --- a/src/game/license_timer/timer.js +++ b/src/game/license_timer/timer.js @@ -51,7 +51,7 @@ Timer.prototype.loadDataFromServer = function() { sessionStorageManager.getPlayerID(), Timer.TIME_DEFAULT_SEC, (function(replyJson) { - console.log(replyJson); + // console.log(replyJson); if(replyJson.leftTime == null || replyJson.leftTime == 0) { this.startTime = replyJson.startTime; @@ -231,8 +231,12 @@ Timer.prototype.makePauseButton = function() { setting, null, "∥", (function() { - this.updateLeftTimeToServer(); this.pauseTimer(); + + if(this.leftTime > 0) + this.updateLeftTimeToServer(); + else + this.resetLeftTimeToServer(); }).bind(this) ); } @@ -577,39 +581,38 @@ Timer.prototype.setStartTime = function(time) { Timer.prototype.updateStartTimeToServer = function() { - // send to server - console.log("send start time to server : " + this.startTime); + // console.log("send start time to server : " + this.startTime); this.dbConnectManager.updateLicenseStartTime( sessionStorageManager.getMaestroID(), sessionStorageManager.getPlayerID(), this.startTime, - (function(replyJson) { console.log(replyJson); }).bind(this), - (function(replyJson) { console.log(replyJson); }) + (function(replyJson) { /*console.log(replyJson);*/ }).bind(this), + (function(replyJson) { /*console.log(replyJson);*/ }) ); } Timer.prototype.resetLeftTimeToServer = function() { - console.log("send left time to server : " + this.leftTime); + // console.log("send left time to server : " + this.leftTime); this.dbConnectManager.updateLicenseLeftTime( sessionStorageManager.getMaestroID(), sessionStorageManager.getPlayerID(), 0, - (function(replyJson) { console.log(replyJson); }).bind(this), - (function(replyJson) { console.log(replyJson); }) + (function(replyJson) { /*console.log(replyJson);*/ }).bind(this), + (function(replyJson) { /*console.log(replyJson);*/ }) ); }, Timer.prototype.updateLeftTimeToServer = function() { - console.log("send left time to server : " + this.leftTime); + // console.log("send left time to server : " + this.leftTime); this.dbConnectManager.updateLicenseLeftTime( sessionStorageManager.getMaestroID(), sessionStorageManager.getPlayerID(), this.leftTime, - (function(replyJson) { console.log(replyJson); }).bind(this), - (function(replyJson) { console.log(replyJson); }) + (function(replyJson) { /*console.log(replyJson);*/ }).bind(this), + (function(replyJson) { /*console.log(replyJson);*/ }) ); },