diff --git a/app/static/css/cassandra.css b/app/static/css/cassandra.css index 541ae6d..e63c24f 100644 --- a/app/static/css/cassandra.css +++ b/app/static/css/cassandra.css @@ -2331,6 +2331,9 @@ a.btn-secondary:hover { color: var(--accent); border-color: var(--accent); } color: var(--accent); border-color: var(--accent); } +/* The JS toggles these via the `hidden` attribute. `display: inline-flex` + * above otherwise wins over the UA's `[hidden] { display: none }`. */ +.pf-edit-btn[hidden], .pf-done-btn[hidden] { display: none; } /* × button per row — hidden by default, visible only in edit mode. */ .pf-row-del-cell { width: 20px; text-align: center; } diff --git a/app/static/js/portfolio.js b/app/static/js/portfolio.js index dfbcbfa..21e4358 100644 --- a/app/static/js/portfolio.js +++ b/app/static/js/portfolio.js @@ -272,6 +272,13 @@ function renderPanel(mount, pie, enriched, agg) { var panel = document.getElementById('portfolio-panel'); if (panel) panel.classList.remove('pf-empty'); + // The empty-state path forces the add form visible. When we move + // back to a populated view we re-hide it — unless edit mode is on, + // in which case the form stays visible for ongoing edits. + var form = document.getElementById('pf-add-form'); + if (form && panel && !panel.classList.contains('pf-editing')) { + form.hidden = true; + } const ccyPills = Object.keys(agg.by_currency) .sort((a, b) => agg.by_currency[b] - agg.by_currency[a])