Skip to content

Commit

Permalink
Review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoPavlinic98 committed Mar 27, 2024
1 parent 3e88422 commit bd4972b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions assets/js/media-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
Expand All @@ -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();
}
});

Expand Down
2 changes: 1 addition & 1 deletion includes/settings/class-wcpdf-settings-callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']}]" ) ) {
Expand Down

0 comments on commit bd4972b

Please sign in to comment.