diff --git a/popup.css b/popup.css
index 3ec8fd3..2941c92 100644
--- a/popup.css
+++ b/popup.css
@@ -226,8 +226,8 @@ h2 {
border: 1px solid #0f3460;
border-radius: 6px;
padding: 0 2px;
- width: 190px;
- height: 24px;
+ width: 220px;
+ height: 22px;
box-sizing: border-box;
overflow: hidden;
}
@@ -757,7 +757,7 @@ h2 {
}
.btn-io {
- padding: 4px 10px;
+ padding: 4px 1px;
background: transparent;
border: none;
border-radius: 6px;
diff --git a/popup.html b/popup.html
index 544b858..0285ba6 100644
--- a/popup.html
+++ b/popup.html
@@ -130,8 +130,8 @@
diff --git a/popup.js b/popup.js
index 8e7330a..f8b14a1 100644
--- a/popup.js
+++ b/popup.js
@@ -43,6 +43,9 @@ document.addEventListener("DOMContentLoaded", () => {
applyI18n();
+ const versionLabel = $("versionLabel");
+ if (versionLabel) versionLabel.textContent = "v" + chrome.runtime.getManifest().version;
+
const domainInput = $("domain");
const aliasInput = $("alias");
const usernameInput = $("username");
@@ -664,10 +667,12 @@ document.addEventListener("DOMContentLoaded", () => {
exportBtn.disabled = isEmpty;
exportBtn.classList.toggle("btn-disabled", isEmpty);
const parent = addSection.parentElement;
- if (isEmpty) {
- if (parent.children[0] !== addSection) parent.insertBefore(addSection, listSection);
- } else {
- if (parent.children[0] !== listSection) parent.insertBefore(listSection, addSection);
+ const addIdx = Array.prototype.indexOf.call(parent.children, addSection);
+ const listIdx = Array.prototype.indexOf.call(parent.children, listSection);
+ if (isEmpty && addIdx > listIdx) {
+ parent.insertBefore(addSection, listSection);
+ } else if (!isEmpty && listIdx > addIdx) {
+ parent.insertBefore(listSection, addSection);
}
if (isEmpty) {
@@ -937,6 +942,7 @@ document.addEventListener("DOMContentLoaded", () => {
searchToggleBtn.addEventListener("click", () => {
searchInput.value = "";
searchKeyword = "";
+ searchClear.hidden = true;
searchBox.hidden = true;
searchBtn.hidden = false;
renderConfigList();
@@ -945,6 +951,7 @@ document.addEventListener("DOMContentLoaded", () => {
// 搜索输入:实时过滤
searchInput.addEventListener("input", () => {
searchKeyword = searchInput.value;
+ searchClear.hidden = !searchKeyword;
renderConfigList();
});
@@ -952,6 +959,7 @@ document.addEventListener("DOMContentLoaded", () => {
searchClear.addEventListener("click", () => {
searchInput.value = "";
searchKeyword = "";
+ searchClear.hidden = true;
renderConfigList();
searchInput.focus();
});