From 6b5866524d44875a6d72c62ee01c35e9b75a2c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 25 Aug 2023 16:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E6=B6=88=E6=81=AF=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=97=B6=E9=A1=B5=E9=9D=A2=E6=A0=87=E9=A2=98=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=82=B9=E7=AC=A6=E5=8F=B7=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/views/@default/@layout.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/views/@default/@layout.js b/web/views/@default/@layout.js index 7bcea3c9..beb33ff6 100644 --- a/web/views/@default/@layout.js +++ b/web/views/@default/@layout.js @@ -60,6 +60,18 @@ Tea.context(function () { .params({}) .success(function (resp) { this.globalMessageBadge = resp.data.count + + // add dot to title + let dots = "••• " + if (typeof document.title == "string") { + if (resp.data.count > 0) { + if (!document.title.startsWith(dots)) { + document.title = dots + document.title + } + } else if (document.title.startsWith(dots)) { + document.title = document.title.substring(dots.length) + } + } }) .done(function () { let delay = 6000