mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Fix ApmButton margin condition.
This commit is contained in:
parent
ec0dd5221d
commit
c59f6de143
1 changed files with 2 additions and 8 deletions
|
@ -73,24 +73,18 @@ export class ApmButtons {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check first apm button
|
// Check first apm button
|
||||||
const $firstApmButton = $container.find(this.selector + ':visible').first();
|
|
||||||
const $firstElement = $container.children(':visible').first();
|
const $firstElement = $container.children(':visible').first();
|
||||||
|
|
||||||
let isFirstElement = false;
|
|
||||||
if ($firstApmButton.is($firstElement)) {
|
|
||||||
isFirstElement = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assign margins to buttons
|
// Assign margins to buttons
|
||||||
$container.find(this.selector).each((index, el) => {
|
$container.find(this.selector).each((index, el) => {
|
||||||
const $el = jQuery(el);
|
const $el = jQuery(el);
|
||||||
const height = $el.height();
|
|
||||||
|
|
||||||
if (isFirstElement) {
|
if ($el.is($firstElement)) {
|
||||||
$el.css('margin-top', `0px`);
|
$el.css('margin-top', `0px`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const height = $el.height();
|
||||||
$el.css('margin-top', `${Math.round(height * 0.3)}px`);
|
$el.css('margin-top', `${Math.round(height * 0.3)}px`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue