This repository was archived by the owner on Feb 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
assets/js/blocks/product-gallery Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,10 @@ export const moveInnerBlocksToPosition = (
140140 const productGalleryBlock = getBlock ( clientId ) ;
141141
142142 if ( productGalleryBlock ) {
143+ const previousLayout = productGalleryBlock . innerBlocks . length
144+ ? productGalleryBlock . innerBlocks [ 0 ] . attributes . layout
145+ : null ;
146+
143147 const thumbnailsBlock = findBlock ( {
144148 blocks : [ productGalleryBlock ] ,
145149 findCondition ( block ) {
@@ -182,6 +186,22 @@ export const moveInnerBlocksToPosition = (
182186 clientId
183187 ) ;
184188
189+ setGroupBlockLayoutByThumbnailsPosition (
190+ thumbnailsPosition ,
191+ productGalleryBlock . innerBlocks [ 0 ] . clientId
192+ ) ;
193+
194+ if ( previousLayout ) {
195+ const orientation =
196+ getGroupLayoutAttributes ( thumbnailsPosition ) . orientation ;
197+ updateBlockAttributes (
198+ {
199+ layout : { ...previousLayout , orientation } ,
200+ } ,
201+ productGalleryBlock . innerBlocks [ 0 ]
202+ ) ;
203+ }
204+
185205 if (
186206 ( ( thumbnailsPosition === 'bottom' ||
187207 thumbnailsPosition === 'right' ) &&
You can’t perform that action at this time.
0 commit comments