style: place Download PDF button inline with total units, left-aligned

This commit is contained in:
adrianbonpin
2026-08-18 19:34:31 +08:00
parent b09e0cea76
commit 8bcfee341c
+12 -3
View File
@@ -181,14 +181,23 @@
if (document.getElementById(BTN_ID)) return; if (document.getElementById(BTN_ID)) return;
const unitsP = findTotalUnitsP(); const unitsP = findTotalUnitsP();
if (!unitsP) return; if (!unitsP) return;
const wrapper = document.createElement('div');
wrapper.style.display = 'flex';
wrapper.style.alignItems = 'center';
wrapper.style.justifyContent = 'space-between';
wrapper.style.margin = '10px 0';
const btn = document.createElement('button'); const btn = document.createElement('button');
btn.id = BTN_ID; btn.id = BTN_ID;
btn.type = 'button'; btn.type = 'button';
btn.className = 'btn green pull-right'; btn.className = 'btn green';
btn.style.margin = '10px 0';
btn.innerHTML = '<i class="fa fa-download"></i> Download PDF'; btn.innerHTML = '<i class="fa fa-download"></i> Download PDF';
btn.addEventListener('click', onDownloadPdf); btn.addEventListener('click', onDownloadPdf);
unitsP.insertAdjacentElement('afterend', btn);
unitsP.parentNode.insertBefore(wrapper, unitsP);
wrapper.appendChild(btn);
wrapper.appendChild(unitsP);
} }
function tryInjectButton() { function tryInjectButton() {