Loop panels to disable options rather than look at values
This commit is contained in:
parent
0469bbe8b0
commit
5a48c41209
|
@ -470,13 +470,13 @@ jQuery( function( $ ) {
|
||||||
show_and_hide_panels();
|
show_and_hide_panels();
|
||||||
|
|
||||||
// Make sure the dropdown is not disabled for empty value attributes.
|
// Make sure the dropdown is not disabled for empty value attributes.
|
||||||
var nr_elements = original_data.length / 6;
|
$( 'select.attribute_taxonomy' ).find( 'option' ).prop( 'disabled', false );
|
||||||
for ( var i = 0; i < nr_elements; i++ ) {
|
|
||||||
if ( typeof( original_data ) !== 'undefined' && original_data[ i * 6 + 2 ].value === '' ) {
|
$( '.product_attributes .woocommerce_attribute' ).each( function( index, el ) {
|
||||||
$( 'select.attribute_taxonomy' )
|
if ( $( el ).css( 'display' ) !== 'none' && $( el ).is( '.taxonomy' ) ) {
|
||||||
.find( 'option[value="' + original_data[ i * 6 ].value + '"]' ).removeAttr( 'disabled' );
|
$( 'select.attribute_taxonomy' ).find( 'option[value="' + $( el ).data( 'taxonomy' ) + '"]' ).prop( 'disabled', true );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Reload variations panel.
|
// Reload variations panel.
|
||||||
var this_page = window.location.toString();
|
var this_page = window.location.toString();
|
||||||
|
|
Loading…
Reference in New Issue