Merge pull request #25103 from woocommerce/fix/24417
Fixed media element initialization for product variation descriptions
This commit is contained in:
commit
329c587c5f
|
@ -88,6 +88,18 @@
|
|||
event.data.variationForm.$form.find( '.single_add_to_cart_button' ).removeClass( 'wc-variation-selection-needed' ).addClass( 'disabled wc-variation-is-unavailable' );
|
||||
event.data.variationForm.$form.find( '.woocommerce-variation-add-to-cart' ).removeClass( 'woocommerce-variation-add-to-cart-enabled' ).addClass( 'woocommerce-variation-add-to-cart-disabled' );
|
||||
}
|
||||
|
||||
// If present, the media element library needs initialized on the variation description.
|
||||
if ( wp.mediaelement ) {
|
||||
event.data.variationForm.$form.find( '.wp-audio-shortcode, .wp-video-shortcode' )
|
||||
.not( '.mejs-container' )
|
||||
.filter(
|
||||
function () {
|
||||
return ! $( this ).parent().hasClass( 'mejs-mediaelement' );
|
||||
}
|
||||
)
|
||||
.mediaelementplayer( wp.mediaelement.settings );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue