refactor(entries): drop the inline copy button, the row menu carries it
Row is down to label | value (eye inside) | menu.
This commit is contained in:
@@ -4291,17 +4291,15 @@ function buildCustomFieldRow(field, idx, rerender) {
|
||||
valueInput.type = field.is_secret ? 'password' : 'text';
|
||||
}
|
||||
|
||||
const copyBtn = el('button', { class: 'icon-btn icon-btn-sm', type: 'button',
|
||||
title: 'Copy value' });
|
||||
copyBtn.appendChild(icon('i-copy'));
|
||||
copyBtn.addEventListener('click', ev => {
|
||||
ev.stopPropagation();
|
||||
// Copying lives in the row menu only — no button of its own, the row is
|
||||
// already carrying a label, a value and the reveal eye.
|
||||
function copyValue() {
|
||||
const v = field.value || '';
|
||||
if (!v) return;
|
||||
if (Bridge.active) Bridge.copySecure(v, 30000);
|
||||
else { try { navigator.clipboard.writeText(v); } catch (_) {} }
|
||||
toast('Copied' + clipClearSuffix());
|
||||
});
|
||||
}
|
||||
|
||||
// Row menu — reuses the card kebab classes, so the document-level
|
||||
// "click outside .entry-kebab-wrap closes it" handler covers it for free.
|
||||
@@ -4322,7 +4320,7 @@ function buildCustomFieldRow(field, idx, rerender) {
|
||||
copyItem.addEventListener('click', ev => {
|
||||
ev.stopPropagation();
|
||||
kebabMenu.classList.remove('is-open');
|
||||
copyBtn.click();
|
||||
copyValue();
|
||||
});
|
||||
kebabMenu.appendChild(copyItem);
|
||||
|
||||
@@ -4367,7 +4365,6 @@ function buildCustomFieldRow(field, idx, rerender) {
|
||||
|
||||
row.appendChild(labelInput);
|
||||
row.appendChild(valueWrap);
|
||||
row.appendChild(copyBtn);
|
||||
row.appendChild(kebabWrap);
|
||||
applySecretState();
|
||||
return row;
|
||||
|
||||
Reference in New Issue
Block a user