Merge pull request #9593 from woothemes/issue-9592/SVG-variation-images
Add conditional check for the selected variation image
This commit is contained in:
commit
351cdee37c
|
@ -285,7 +285,7 @@ jQuery( function( $ ) {
|
||||||
wc_meta_boxes_product_variations_media.variable_image_frame.on( 'select', function () {
|
wc_meta_boxes_product_variations_media.variable_image_frame.on( 'select', function () {
|
||||||
|
|
||||||
var attachment = wc_meta_boxes_product_variations_media.variable_image_frame.state().get( 'selection' ).first().toJSON(),
|
var attachment = wc_meta_boxes_product_variations_media.variable_image_frame.state().get( 'selection' ).first().toJSON(),
|
||||||
url = attachment.sizes.thumbnail ? attachment.sizes.thumbnail.url : attachment.url;
|
url = attachment.sizes && attachment.sizes.thumbnail ? attachment.sizes.thumbnail.url : attachment.url;
|
||||||
|
|
||||||
$( '.upload_image_id', wc_meta_boxes_product_variations_media.setting_variation_image ).val( attachment.id ).change();
|
$( '.upload_image_id', wc_meta_boxes_product_variations_media.setting_variation_image ).val( attachment.id ).change();
|
||||||
wc_meta_boxes_product_variations_media.setting_variation_image.find( '.upload_image_button' ).addClass( 'remove' );
|
wc_meta_boxes_product_variations_media.setting_variation_image.find( '.upload_image_button' ).addClass( 'remove' );
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue