Pledge edit button: Style the dialog on small screens

This commit is contained in:
Kelly Dwan 2024-09-02 18:57:21 -04:00
parent be62f41e43
commit c703c7cefa
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D
3 changed files with 27 additions and 2 deletions

View file

@ -20,6 +20,13 @@ jQuery( document ).ready( function( $ ) {
const bounds = button.getBoundingClientRect();
const modalWidth = 300; // Modal width is hardcoded, because it's not visible yet.
if ( button.closest('.wp-block-wporg-pledge-edit-button') ) {
return {
top: bounds.y + offsetTop + bounds.height,
left: bounds.x + offsetLeft,
};
}
return {
top: bounds.y + offsetTop + bounds.height,
left: bounds.x + offsetLeft + bounds.width - modalWidth,