Fixed tooltips load for variations
This commit is contained in:
parent
c0ca144d57
commit
4aae7b99be
|
@ -57,7 +57,10 @@ jQuery( function( $ ) {
|
||||||
* Run actions when variations is loaded
|
* Run actions when variations is loaded
|
||||||
*/
|
*/
|
||||||
variations_loaded: function() {
|
variations_loaded: function() {
|
||||||
|
// Show/hide downloadable, virtual and stock fields
|
||||||
$( 'input.variable_is_downloadable, input.variable_is_virtual, input.variable_manage_stock', $( this ) ).change();
|
$( 'input.variable_is_downloadable, input.variable_is_virtual, input.variable_manage_stock', $( this ) ).change();
|
||||||
|
|
||||||
|
// Open sale schedule fields when have some sale price date
|
||||||
$( '.woocommerce_variation', $( this ) ).each( function( index, el ) {
|
$( '.woocommerce_variation', $( this ) ).each( function( index, el ) {
|
||||||
var $el = $( el ),
|
var $el = $( el ),
|
||||||
date_from = $( '.sale_price_dates_from', $el ).val(),
|
date_from = $( '.sale_price_dates_from', $el ).val(),
|
||||||
|
@ -67,8 +70,22 @@ jQuery( function( $ ) {
|
||||||
$( 'a.sale_schedule', $el ).click();
|
$( 'a.sale_schedule', $el ).click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Remove variation-needs-update classes
|
||||||
$( '.woocommerce_variations .variation-needs-update', $( this ) ).removeClass( 'variation-needs-update' );
|
$( '.woocommerce_variations .variation-needs-update', $( this ) ).removeClass( 'variation-needs-update' );
|
||||||
|
|
||||||
|
// Disable save button
|
||||||
$( 'button.save-variation-changes', $( this ) ).attr( 'disabled', 'disabled' );
|
$( 'button.save-variation-changes', $( this ) ).attr( 'disabled', 'disabled' );
|
||||||
|
|
||||||
|
// Init TipTip
|
||||||
|
$( '#tiptip_holder' ).removeAttr( 'style' );
|
||||||
|
$( '#tiptip_arrow' ).removeAttr( 'style' );
|
||||||
|
$( '.woocommerce_variations .tips' ).tipTip({
|
||||||
|
'attribute': 'data-tip',
|
||||||
|
'fadeIn': 50,
|
||||||
|
'fadeOut': 50,
|
||||||
|
'delay': 200
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -77,7 +77,7 @@ jQuery( function( $ ) {
|
||||||
|
|
||||||
var label = $( 'input[name=_visibility]:checked' ).attr( 'data-label' );
|
var label = $( 'input[name=_visibility]:checked' ).attr( 'data-label' );
|
||||||
|
|
||||||
if ( current_featured === 'yes' ) {
|
if ( 'yes' === current_featured ) {
|
||||||
label = label + ', ' + woocommerce_admin_meta_boxes.featured_label;
|
label = label + ', ' + woocommerce_admin_meta_boxes.featured_label;
|
||||||
$( 'input[name=_featured]' ).attr( 'checked', 'checked' );
|
$( 'input[name=_featured]' ).attr( 'checked', 'checked' );
|
||||||
} else {
|
} else {
|
||||||
|
@ -279,7 +279,13 @@ jQuery( function( $ ) {
|
||||||
security: woocommerce_admin_meta_boxes.add_attribute_nonce
|
security: woocommerce_admin_meta_boxes.add_attribute_nonce
|
||||||
};
|
};
|
||||||
|
|
||||||
$wrapper.block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } });
|
$wrapper.block({
|
||||||
|
message: null,
|
||||||
|
overlayCSS: {
|
||||||
|
background: '#fff',
|
||||||
|
opacity: 0.6
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
||||||
$wrapper.append( response );
|
$wrapper.append( response );
|
||||||
|
|
Loading…
Reference in New Issue