Closes woocommerce/woocommerce-blocks#59: Individual products - remove rows slider
This commit is contained in:
parent
710e8d03eb
commit
08ec9fa803
|
@ -785,6 +785,20 @@ registerBlockType('woocommerce/products', {
|
|||
});
|
||||
}
|
||||
|
||||
// Row settings don't make sense for specific-selected products display.
|
||||
var rowControl = null;
|
||||
if ('specific' !== display) {
|
||||
rowControl = wp.element.createElement(RangeControl, {
|
||||
label: __('Rows'),
|
||||
value: rows,
|
||||
onChange: function onChange(value) {
|
||||
return setAttributes({ rows: value });
|
||||
},
|
||||
min: 1,
|
||||
max: 6
|
||||
});
|
||||
}
|
||||
|
||||
return wp.element.createElement(
|
||||
InspectorControls,
|
||||
{ key: 'inspector' },
|
||||
|
@ -794,15 +808,7 @@ registerBlockType('woocommerce/products', {
|
|||
__('Layout')
|
||||
),
|
||||
columnControl,
|
||||
wp.element.createElement(RangeControl, {
|
||||
label: __('Rows'),
|
||||
value: rows,
|
||||
onChange: function onChange(value) {
|
||||
return setAttributes({ rows: value });
|
||||
},
|
||||
min: 1,
|
||||
max: 6
|
||||
}),
|
||||
rowControl,
|
||||
orderControl
|
||||
);
|
||||
};
|
||||
|
|
|
@ -525,10 +525,10 @@ registerBlockType( 'woocommerce/products', {
|
|||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<InspectorControls key="inspector">
|
||||
<h3>{ __( 'Layout' ) }</h3>
|
||||
{ columnControl }
|
||||
// Row settings don't make sense for specific-selected products display.
|
||||
let rowControl = null;
|
||||
if ( 'specific' !== display ) {
|
||||
rowControl = (
|
||||
<RangeControl
|
||||
label={ __( 'Rows' ) }
|
||||
value={ rows }
|
||||
|
@ -536,6 +536,14 @@ registerBlockType( 'woocommerce/products', {
|
|||
min={ 1 }
|
||||
max={ 6 }
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<InspectorControls key="inspector">
|
||||
<h3>{ __( 'Layout' ) }</h3>
|
||||
{ columnControl }
|
||||
{ rowControl }
|
||||
{ orderControl }
|
||||
</InspectorControls>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue