From 6614d3eeb9a3d501fa7df626db59e4b9e3977625 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Thu, 11 Mar 2021 18:45:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=87=E9=A2=98=E9=97=AA?= =?UTF-8?q?=E7=83=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/gofly-front.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/js/gofly-front.js b/static/js/gofly-front.js index af5b850..1d7bf29 100644 --- a/static/js/gofly-front.js +++ b/static/js/gofly-front.js @@ -80,12 +80,13 @@ GOFLY.init=function(config){ } if(msg.type=="focus"){ clearTimeout(_this.titleTimer); + _this.titleTimer=0; document.title = _this.originTitle; } }); window.onfocus = function () { clearTimeout(_this.titleTimer); - console.log(1); + _this.titleTimer=0; document.title = _this.originTitle; }; } @@ -269,6 +270,12 @@ GOFLY.windowOpen=function (){ window.open(this.GOFLY_URL+'/chatIndex?kefu_id='+this.GOFLY_KEFU_ID+'&lang='+this.GOFLY_LANG+'&refer='+window.document.title+'&extra='+this.GOFLY_EXTRA); } GOFLY.flashTitle=function () { + if(this.titleTimer!=0){ + return; + } + this.titleTimer = setInterval("GOFLY.flashTitleFunc()", 500); +} +GOFLY.flashTitleFunc=function(){ this.titleNum++; if (this.titleNum >=3) { this.titleNum = 1; @@ -279,7 +286,6 @@ GOFLY.flashTitle=function () { if (this.titleNum == 2) { document.title = '【new message】' + this.originTitle; } - this.titleTimer = setTimeout("GOFLY.flashTitle()", 500); }