From 23a599f7ca299bdfeafe7d1c5b02c2e5e9bd2fb6 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Thu, 11 Mar 2021 17:55:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=87=E9=A2=98=E6=80=BB?= =?UTF-8?q?=E6=98=AF=E6=8F=90=E7=A4=BA=E6=96=B0=E6=B6=88=E6=81=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/chat-page.js | 1 + static/js/gofly-front.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/static/js/chat-page.js b/static/js/chat-page.js index dcedafa..3f655aa 100644 --- a/static/js/chat-page.js +++ b/static/js/chat-page.js @@ -366,6 +366,7 @@ new Vue({ $('.faceBox').hide(); }); window.onfocus = function () { + window.parent.postMessage({type:"focus"},"*"); if(_this.socketClosed){ return; } diff --git a/static/js/gofly-front.js b/static/js/gofly-front.js index 98da0c5..af5b850 100644 --- a/static/js/gofly-front.js +++ b/static/js/gofly-front.js @@ -78,9 +78,13 @@ GOFLY.init=function(config){ var news=$("#launchIcon").text(); $("#launchIcon").text(++news).show(); } + if(msg.type=="focus"){ + clearTimeout(_this.titleTimer); + document.title = _this.originTitle; + } }); window.onfocus = function () { - clearTimeout(this.titleTimer); + clearTimeout(_this.titleTimer); console.log(1); document.title = _this.originTitle; };