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(
|
return wp.element.createElement(
|
||||||
InspectorControls,
|
InspectorControls,
|
||||||
{ key: 'inspector' },
|
{ key: 'inspector' },
|
||||||
|
@ -794,15 +808,7 @@ registerBlockType('woocommerce/products', {
|
||||||
__('Layout')
|
__('Layout')
|
||||||
),
|
),
|
||||||
columnControl,
|
columnControl,
|
||||||
wp.element.createElement(RangeControl, {
|
rowControl,
|
||||||
label: __('Rows'),
|
|
||||||
value: rows,
|
|
||||||
onChange: function onChange(value) {
|
|
||||||
return setAttributes({ rows: value });
|
|
||||||
},
|
|
||||||
min: 1,
|
|
||||||
max: 6
|
|
||||||
}),
|
|
||||||
orderControl
|
orderControl
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -525,10 +525,10 @@ registerBlockType( 'woocommerce/products', {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
// Row settings don't make sense for specific-selected products display.
|
||||||
<InspectorControls key="inspector">
|
let rowControl = null;
|
||||||
<h3>{ __( 'Layout' ) }</h3>
|
if ( 'specific' !== display ) {
|
||||||
{ columnControl }
|
rowControl = (
|
||||||
<RangeControl
|
<RangeControl
|
||||||
label={ __( 'Rows' ) }
|
label={ __( 'Rows' ) }
|
||||||
value={ rows }
|
value={ rows }
|
||||||
|
@ -536,6 +536,14 @@ registerBlockType( 'woocommerce/products', {
|
||||||
min={ 1 }
|
min={ 1 }
|
||||||
max={ 6 }
|
max={ 6 }
|
||||||
/>
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<InspectorControls key="inspector">
|
||||||
|
<h3>{ __( 'Layout' ) }</h3>
|
||||||
|
{ columnControl }
|
||||||
|
{ rowControl }
|
||||||
{ orderControl }
|
{ orderControl }
|
||||||
</InspectorControls>
|
</InspectorControls>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue