05/07: updated add password item's Advanced Settings

This commit is contained in:
2026-05-07 13:24:31 -04:00
parent 94c0467d12
commit f71032096b
3 changed files with 201 additions and 0 deletions
+33
View File
@@ -2878,6 +2878,16 @@ const Vault = (() => {
form.dataset.mode = mode;
form.dataset.itemId = item ? item.id : "";
// Always start Advanced Settings collapsed when the modal opens.
const advBody = document.getElementById("adv-settings-body");
const advToggle = document.getElementById("adv-settings-toggle");
if (advBody) advBody.classList.add("hidden");
if (advToggle) {
advToggle.setAttribute("aria-expanded", "false");
const chevron = advToggle.querySelector(".adv-section-chevron");
if (chevron) chevron.textContent = "\u2964";
}
const folderSel = document.getElementById("field-folder");
folderSel.innerHTML = '<option value="">— No folder —</option>';
_folders.forEach((f) => {
@@ -2912,6 +2922,13 @@ const Vault = (() => {
setVal("field-totp-uri", p.totp_uri || "");
setVal("field-notes", p.notes);
setVal("field-tags", (p.tags || []).join(", "));
// Advanced Settings
document.getElementById("field-autofill").checked =
p.autofill !== false; // default true
document.getElementById("field-autologin").checked =
!!p.autologin;
document.getElementById("field-reprompt").checked =
!!p.reprompt;
break;
case "note":
setVal("field-note-body", p.note_body);
@@ -2988,6 +3005,9 @@ const Vault = (() => {
totp_uri: getVal("field-totp-uri").trim(),
notes: getVal("field-notes").trim(),
tags: _parseTags(getVal("field-tags")),
autofill: document.getElementById("field-autofill")?.checked ?? true,
autologin: !!document.getElementById("field-autologin")?.checked,
reprompt: !!document.getElementById("field-reprompt")?.checked,
};
case "note":
return { note_body: getVal("field-note-body") };
@@ -3406,6 +3426,19 @@ const Vault = (() => {
.join("");
});
// Advanced Settings collapsible toggle
document
.getElementById("adv-settings-toggle")
?.addEventListener("click", () => {
const body = document.getElementById("adv-settings-body");
const btn = document.getElementById("adv-settings-toggle");
const chevron = btn.querySelector(".adv-section-chevron");
const isOpen = !body.classList.contains("hidden");
body.classList.toggle("hidden", isOpen);
btn.setAttribute("aria-expanded", String(!isOpen));
chevron.textContent = isOpen ? "\u2964" : "\u2963";
});
// Sidebar navigation
document.getElementById("sidebar-all")?.addEventListener("click", () => {
_activeFilter = null;