unified header_title template values across dashboard applet destination pages; styled &/ added applet titles across all applets
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -23,15 +23,22 @@ const initWallet = () => {
|
||||
const section = addBtn.closest('section');
|
||||
const rowPx = 3 * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
||||
const updateRows = () => {
|
||||
const rows = Math.ceil(section.scrollHeight / rowPx) + 1;
|
||||
const sectionTop = section.getBoundingClientRect().top;
|
||||
let maxBottom = sectionTop;
|
||||
for (const child of section.children) {
|
||||
if (child.hidden) continue;
|
||||
maxBottom = Math.max(maxBottom, child.getBoundingClientRect().bottom);
|
||||
}
|
||||
const padBot = parseFloat(getComputedStyle(section).paddingBottom);
|
||||
const rows = Math.ceil((maxBottom - sectionTop + padBot) / rowPx) + 1;
|
||||
section.style.setProperty('--applet-rows', String(rows));
|
||||
};
|
||||
paymentEl.on('ready', () => {
|
||||
updateRows();
|
||||
const iframe = document.querySelector('#id_stripe_payment_element iframe');
|
||||
if (iframe) {
|
||||
const obs = new MutationObserver(updateRows);
|
||||
obs.observe(iframe, { attributes: true, attributeFilter: ['style'] });
|
||||
const stripeContainer = document.getElementById('id_stripe_payment_element');
|
||||
if (stripeContainer) {
|
||||
const obs = new ResizeObserver(updateRows);
|
||||
obs.observe(stripeContainer);
|
||||
section._stripeObs = obs;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user