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; };