diff --git a/assets/js/media-upload.js b/assets/js/media-upload.js index d9474b9af..66be29cda 100644 --- a/assets/js/media-upload.js +++ b/assets/js/media-upload.js @@ -55,8 +55,8 @@ jQuery(document).ready(function($) { } $( '.attachment-resolution, .attachment-resolution-warning' ).remove(); - // dim until we have a response - $settings_wrapper.css( 'opacity', '0.25' ); + // block the UI until we have a response + $.blockUI({ message: '' }); let data = { security: $input.data( 'ajax_nonce' ), @@ -74,13 +74,14 @@ jQuery(document).ready(function($) { $settings_wrapper.html( response.data ); } $settings_wrapper.removeAttr( 'style' ); + $.unblockUI(); // custom trigger $input = get_media_field( $( this ), $settings_wrapper, 'input.media-upload-id' ); $( document.body ).trigger( 'wpo-wcpdf-media-upload-setting-updated', [ $input ] ); }, error: function (xhr, ajaxOptions, thrownError) { - $settings_wrapper.removeAttr( 'style' ); + $.unblockUI(); } }); diff --git a/includes/settings/class-wcpdf-settings-callbacks.php b/includes/settings/class-wcpdf-settings-callbacks.php index 62bf0d081..d3b987bcf 100644 --- a/includes/settings/class-wcpdf-settings-callbacks.php +++ b/includes/settings/class-wcpdf-settings-callbacks.php @@ -725,7 +725,7 @@ public function validate( $input ) { * @param string $setting Settings field that needs a language. * @param array $args Setting arguments. * - * @return void + * @return string */ public function append_language( string $setting, array $args ): string { if ( isset( $args['translatable'] ) && isset( $args['lang'] ) && 'default' !== $args['lang'] && true == $args['translatable'] && ! ( substr( $setting, -strlen( "[{$args['lang']}]" ) ) === "[{$args['lang']}]" ) ) {