Fix GooglePay preview buttons

This commit is contained in:
Pedro Silva 2023-10-16 17:56:58 +01:00
parent 8847cbbd21
commit 9ab11b40e4
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
3 changed files with 24 additions and 4 deletions

View file

@ -36,6 +36,17 @@ import widgetBuilder from "../../../ppcp-button/resources/js/modules/Renderer/Wi
}
});
// Maybe we can find a more elegant reload method when transitioning from styling modes.
jQuery([
'#ppcp-smart_button_enable_styling_per_location'
].join(',')).on('change', () => {
setTimeout(() => {
for (const [selector, ppcpConfig] of Object.entries(activeButtons)) {
createButton(ppcpConfig);
}
}, 100);
});
const applyConfigOptions = function (buttonConfig) {
buttonConfig.button = buttonConfig.button || {};
buttonConfig.button.style = buttonConfig.button.style || {};