From ac2a063ad7d1f57cc04a5cd388e91885a48472aa Mon Sep 17 00:00:00 2001 From: Levi Yan Date: Thu, 2 Jan 2025 10:47:45 +0800 Subject: [PATCH] feat: focus message when it appear --- templates/devstar-home-vscode.tmpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/devstar-home-vscode.tmpl b/templates/devstar-home-vscode.tmpl index def3369137..94a0dbc049 100644 --- a/templates/devstar-home-vscode.tmpl +++ b/templates/devstar-home-vscode.tmpl @@ -90,8 +90,8 @@
- - + +
@@ -1179,12 +1179,14 @@ if ('positive' == type) { document.getElementById('positive_message').innerHTML = message; document.getElementById('positive_message').style.display = 'block'; + document.getElementById('positive_message').focus(); setTimeout(function () { document.getElementById('positive_message').style.display = 'none'; }, duration); // 消息显示 duration/1000 秒后消失 } else if ('negative' == type){ document.getElementById('negative_message').innerHTML = message; document.getElementById('negative_message').style.display = 'block'; + document.getElementById('negative_message').focus(); setTimeout(function () { document.getElementById('negative_message').style.display = 'none'; }, duration); // 消息显示 duration/1000 秒后消失