This commit is contained in:
Mykyta Synelnikov
2023-07-25 00:31:35 +03:00
parent 9447fb6675
commit 0eae48a9a1
2 changed files with 9 additions and 7 deletions
+8 -6
View File
@@ -124,13 +124,15 @@ jQuery(document).ready(function() {
// Biography (description) fields syncing.
jQuery( '.um-profile form' ).each( function () {
let descKey = jQuery(this).data('description_key');
jQuery( document.body ).on( 'change, input', 'textarea[name="' + descKey + '"]', function ( e ) {
jQuery(this).parents( 'form' ).find( 'textarea[name="' + descKey + '"]' ).each( function() {
if ( jQuery(this)[0] !== e.currentTarget ) {
jQuery(this).parents( 'form' ).find( 'textarea[name="' + descKey + '"]' ).val( e.currentTarget.value ).trigger('change');
}
if ( jQuery(this).find( 'textarea[name="' + descKey + '"]' ).length ) {
jQuery( document.body ).on( 'change, input', 'textarea[name="' + descKey + '"]', function ( e ) {
jQuery(this).parents( 'form' ).find( 'textarea[name="' + descKey + '"]' ).each( function() {
if ( jQuery(this)[0] !== e.currentTarget ) {
jQuery(this).parents( 'form' ).find( 'textarea[name="' + descKey + '"]' ).val( e.currentTarget.value ).trigger('change');
}
});
});
});
}
});