Skip to content

Commit

Permalink
Update edit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
oakesjosh committed Dec 3, 2024
1 parent 9bc37b5 commit f34d368
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions src/blocks/table/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export function Edit(props) {

if (undefined === columns) {
return (
<div {...blockProps} style={{ backgroundColor: '#FFF', border: '2px solid #000', padding: '20px' }}>
<div {...blockProps} style={{ backgroundColor: '#FFF', border: '0.5px solid #000', padding: '20px' }}>
<h4 style={{ marginTop: '0', marginBottom: '15px' }}>{__('Table layout', 'kadence-blocks')}</h4>
<div style={{ maxWidth: '350px' }}>
<RangeControl
Expand Down Expand Up @@ -533,87 +533,87 @@ export function Edit(props) {
initialOpen={false}
>
<ResponsiveRangeControls
label={__('Max Width', 'kadence-blocks')}
label={__('Max Height', 'kadence-blocks')}
reset={true}
value={undefined !== maxWidth && undefined !== maxWidth[0] ? maxWidth[0] : ''}
value={undefined !== maxHeight && undefined !== maxHeight[0] ? maxHeight[0] : ''}
onChange={(value) => {
setAttributes({
maxWidth: [
maxHeight: [
value,
undefined !== maxWidth && undefined !== maxWidth[1] ? maxWidth[1] : '',
undefined !== maxWidth && undefined !== maxWidth[2] ? maxWidth[2] : '',
undefined !== maxHeight && undefined !== maxHeight[1] ? maxHeight[1] : '',
undefined !== maxHeight && undefined !== maxHeight[2] ? maxHeight[2] : '',
],
});
}}
tabletValue={undefined !== maxWidth && undefined !== maxWidth[1] ? maxWidth[1] : ''}
tabletValue={undefined !== maxHeight && undefined !== maxHeight[1] ? maxHeight[1] : ''}
onChangeTablet={(value) => {
setAttributes({
maxWidth: [
undefined !== maxWidth && undefined !== maxWidth[0] ? maxWidth[0] : '',
maxHeight: [
undefined !== maxHeight && undefined !== maxHeight[0] ? maxHeight[0] : '',
value,
undefined !== maxWidth && undefined !== maxWidth[2] ? maxWidth[2] : '',
undefined !== maxHeight && undefined !== maxHeight[2] ? maxHeight[2] : '',
],
});
}}
mobileValue={undefined !== maxWidth && undefined !== maxWidth[2] ? maxWidth[2] : ''}
mobileValue={undefined !== maxHeight && undefined !== maxHeight[2] ? maxHeight[2] : ''}
onChangeMobile={(value) => {
setAttributes({
maxWidth: [
undefined !== maxWidth && undefined !== maxWidth[0] ? maxWidth[0] : '',
undefined !== maxWidth && undefined !== maxWidth[1] ? maxWidth[1] : '',
maxHeight: [
undefined !== maxHeight && undefined !== maxHeight[0] ? maxHeight[0] : '',
undefined !== maxHeight && undefined !== maxHeight[1] ? maxHeight[1] : '',
value,
],
});
}}
min={0}
max={maxWidthUnit === 'px' ? 2000 : 100}
max={maxHeightUnit === 'px' ? 2000 : 100}
step={1}
unit={maxWidthUnit ? maxWidthUnit : '%'}
unit={maxHeightUnit ? maxHeightUnit : 'px'}
onUnit={(value) => {
setAttributes({ maxWidthUnit: value });
setAttributes({ maxHeightUnit: value });
}}
units={['px', '%', 'vw']}
/>

<ResponsiveRangeControls
label={__('Max Height', 'kadence-blocks')}
label={__('Max Width', 'kadence-blocks')}
reset={true}
value={undefined !== maxHeight && undefined !== maxHeight[0] ? maxHeight[0] : ''}
value={undefined !== maxWidth && undefined !== maxWidth[0] ? maxWidth[0] : ''}
onChange={(value) => {
setAttributes({
maxHeight: [
maxWidth: [
value,
undefined !== maxHeight && undefined !== maxHeight[1] ? maxHeight[1] : '',
undefined !== maxHeight && undefined !== maxHeight[2] ? maxHeight[2] : '',
undefined !== maxWidth && undefined !== maxWidth[1] ? maxWidth[1] : '',
undefined !== maxWidth && undefined !== maxWidth[2] ? maxWidth[2] : '',
],
});
}}
tabletValue={undefined !== maxHeight && undefined !== maxHeight[1] ? maxHeight[1] : ''}
tabletValue={undefined !== maxWidth && undefined !== maxWidth[1] ? maxWidth[1] : ''}
onChangeTablet={(value) => {
setAttributes({
maxHeight: [
undefined !== maxHeight && undefined !== maxHeight[0] ? maxHeight[0] : '',
maxWidth: [
undefined !== maxWidth && undefined !== maxWidth[0] ? maxWidth[0] : '',
value,
undefined !== maxHeight && undefined !== maxHeight[2] ? maxHeight[2] : '',
undefined !== maxWidth && undefined !== maxWidth[2] ? maxWidth[2] : '',
],
});
}}
mobileValue={undefined !== maxHeight && undefined !== maxHeight[2] ? maxHeight[2] : ''}
mobileValue={undefined !== maxWidth && undefined !== maxWidth[2] ? maxWidth[2] : ''}
onChangeMobile={(value) => {
setAttributes({
maxHeight: [
undefined !== maxHeight && undefined !== maxHeight[0] ? maxHeight[0] : '',
undefined !== maxHeight && undefined !== maxHeight[1] ? maxHeight[1] : '',
maxWidth: [
undefined !== maxWidth && undefined !== maxWidth[0] ? maxWidth[0] : '',
undefined !== maxWidth && undefined !== maxWidth[1] ? maxWidth[1] : '',
value,
],
});
}}
min={0}
max={maxHeightUnit === 'px' ? 2000 : 100}
max={maxWidthUnit === 'px' ? 2000 : 100}
step={1}
unit={maxHeightUnit ? maxHeightUnit : 'px'}
unit={maxWidthUnit ? maxWidthUnit : '%'}
onUnit={(value) => {
setAttributes({ maxHeightUnit: value });
setAttributes({ maxWidthUnit: value });
}}
units={['px', '%', 'vw']}
/>
Expand Down

0 comments on commit f34d368

Please sign in to comment.