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);*/ }) ); },