variation images. closes #7844

This commit is contained in:
James Koster 2015-04-08 10:19:23 +01:00
parent f6346c705c
commit cd20ce6789
3 changed files with 19 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -3116,16 +3116,17 @@ img.help_tip {
float: left;
margin-right: 20px;
position: relative;
cursor: pointer;
img {
width: 100%;
height: auto;
display: none;
}
&:before {
content: "\f317";
content: "\f128";
font-family: 'Dashicons';
display: none;
position: absolute;
top: 0;
left: 0;
@ -3133,19 +3134,26 @@ img.help_tip {
bottom: 0;
text-align: center;
line-height: 48px;
font-size: 2em;
font-size: 48px;
font-weight: 400;
-webkit-font-smoothing: antialiased;
}
&.remove:before {
content: "\f335";
}
&:hover {
&:before {
&.remove{
img {
display: block;
}
&:before {
content: "\f335";
display: none;
}
&:hover {
&:before {
display: block;
}
}
}
}

View File

@ -59,7 +59,7 @@ extract( $variation_data );
<div class="woocommerce_variable_attributes wc-metabox-content">
<div class="data">
<p class="form-row form-row-first upload_image">
<a href="#" class="upload_image_button <?php if ( $_thumbnail_id > 0 ) echo 'remove'; ?>" rel="<?php echo esc_attr( $variation_id ); ?>"><img src="<?php if ( ! empty( $image ) ) echo esc_attr( $image ); else echo esc_attr( wc_placeholder_img_src() ); ?>" /><input type="hidden" name="upload_image_id[<?php echo $loop; ?>]" class="upload_image_id" value="<?php echo esc_attr( $_thumbnail_id ); ?>" /></a>
<a href="#" class="upload_image_button tips <?php if ( $_thumbnail_id > 0 ) echo 'remove'; ?>" data-tip="<?php if ( $_thumbnail_id > 0 ) { echo __( 'Remove this image', 'woocommerce' ); } else { echo __( 'Upload an image', 'woocommerce' ); } ?>" rel="<?php echo esc_attr( $variation_id ); ?>"><img src="<?php if ( ! empty( $image ) ) echo esc_attr( $image ); else echo esc_attr( wc_placeholder_img_src() ); ?>" /><input type="hidden" name="upload_image_id[<?php echo $loop; ?>]" class="upload_image_id" value="<?php echo esc_attr( $_thumbnail_id ); ?>" /></a>
</p>
<?php if ( wc_product_sku_enabled() ) : ?>
<p class="sku form-row form-row-last">