style: place Download PDF button inline with total units, left-aligned
This commit is contained in:
+12
-3
@@ -181,14 +181,23 @@
|
||||
if (document.getElementById(BTN_ID)) return;
|
||||
const unitsP = findTotalUnitsP();
|
||||
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');
|
||||
btn.id = BTN_ID;
|
||||
btn.type = 'button';
|
||||
btn.className = 'btn green pull-right';
|
||||
btn.style.margin = '10px 0';
|
||||
btn.className = 'btn green';
|
||||
btn.innerHTML = '<i class="fa fa-download"></i> Download PDF';
|
||||
btn.addEventListener('click', onDownloadPdf);
|
||||
unitsP.insertAdjacentElement('afterend', btn);
|
||||
|
||||
unitsP.parentNode.insertBefore(wrapper, unitsP);
|
||||
wrapper.appendChild(btn);
|
||||
wrapper.appendChild(unitsP);
|
||||
}
|
||||
|
||||
function tryInjectButton() {
|
||||
|
||||
Reference in New Issue
Block a user