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:
+2
-2
@@ -1592,9 +1592,9 @@ input[type="range"]::-webkit-slider-thumb {
|
|||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
}
|
}
|
||||||
.so-custom-row {
|
.so-custom-row {
|
||||||
/* label | value (eye inside) | copy | row menu */
|
/* label | value (eye inside) | row menu */
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1.4fr auto auto;
|
grid-template-columns: 1fr 1.4fr auto;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4291,17 +4291,15 @@ function buildCustomFieldRow(field, idx, rerender) {
|
|||||||
valueInput.type = field.is_secret ? 'password' : 'text';
|
valueInput.type = field.is_secret ? 'password' : 'text';
|
||||||
}
|
}
|
||||||
|
|
||||||
const copyBtn = el('button', { class: 'icon-btn icon-btn-sm', type: 'button',
|
// Copying lives in the row menu only — no button of its own, the row is
|
||||||
title: 'Copy value' });
|
// already carrying a label, a value and the reveal eye.
|
||||||
copyBtn.appendChild(icon('i-copy'));
|
function copyValue() {
|
||||||
copyBtn.addEventListener('click', ev => {
|
|
||||||
ev.stopPropagation();
|
|
||||||
const v = field.value || '';
|
const v = field.value || '';
|
||||||
if (!v) return;
|
if (!v) return;
|
||||||
if (Bridge.active) Bridge.copySecure(v, 30000);
|
if (Bridge.active) Bridge.copySecure(v, 30000);
|
||||||
else { try { navigator.clipboard.writeText(v); } catch (_) {} }
|
else { try { navigator.clipboard.writeText(v); } catch (_) {} }
|
||||||
toast('Copied' + clipClearSuffix());
|
toast('Copied' + clipClearSuffix());
|
||||||
});
|
}
|
||||||
|
|
||||||
// Row menu — reuses the card kebab classes, so the document-level
|
// Row menu — reuses the card kebab classes, so the document-level
|
||||||
// "click outside .entry-kebab-wrap closes it" handler covers it for free.
|
// "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 => {
|
copyItem.addEventListener('click', ev => {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
kebabMenu.classList.remove('is-open');
|
kebabMenu.classList.remove('is-open');
|
||||||
copyBtn.click();
|
copyValue();
|
||||||
});
|
});
|
||||||
kebabMenu.appendChild(copyItem);
|
kebabMenu.appendChild(copyItem);
|
||||||
|
|
||||||
@@ -4367,7 +4365,6 @@ function buildCustomFieldRow(field, idx, rerender) {
|
|||||||
|
|
||||||
row.appendChild(labelInput);
|
row.appendChild(labelInput);
|
||||||
row.appendChild(valueWrap);
|
row.appendChild(valueWrap);
|
||||||
row.appendChild(copyBtn);
|
|
||||||
row.appendChild(kebabWrap);
|
row.appendChild(kebabWrap);
|
||||||
applySecretState();
|
applySecretState();
|
||||||
return row;
|
return row;
|
||||||
|
|||||||
Reference in New Issue
Block a user