Skip to content

Commit

Permalink
Adjust image gallery class
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanhuazong committed Feb 20, 2023
1 parent 6b52a49 commit 1e3fa97
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-blocks', 'wp-element', 'wp-icons/build-types', 'wp-primitives', 'wp-server-side-render'), 'version' => 'c3bbbdbcc0c52987e1b0e1eef2d39e69');
<?php return array('dependencies' => array('react', 'wp-blocks', 'wp-element', 'wp-icons/build-types', 'wp-primitives', 'wp-server-side-render'), 'version' => '024cf933165271275f0d88fc92f6a54a');

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/image-gallery/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ registerBlockType( 'purdue-blocks/image-gallery', {
{props.attributes.imgs.length>0?
<div className='columns is-multiline'>
{props.attributes.imgs.map((img, index)=>{
return <div className={`column${props.attributes.columns === "4"?" is-one-quarter-desktop":" is-one-third-desktop"} is-half-tablet is-full-mobile`}>
return <div className={`column${props.attributes.columns === "4"?" is-one-quarter-widescreen":" is-one-third-widescreen"} is-half-tablet is-full-mobile is-one-third-desktop`}>
<div className={ `image-gallery-open${img.caption?"":" image-no-caption"}` } data-toggle={img.id}>
<div className={ `image is-square` }
role="img"
Expand Down
6 changes: 3 additions & 3 deletions src/image-gallery/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ function render_block_purdue_gallery($attributes){
}
if(sizeof($attributes['imgs'])>0){
$output.='<div class="columns is-multiline">';
$column_class[] = 'column is-half-tablet is-full-mobile';
$column_class[] = 'column is-half-tablet is-full-mobile is-one-third-desktop';
if(isset( $attributes['columns'] ) && $attributes['columns'] =="4" ){
$column_class[] = 'is-one-quarter-desktop';
$column_class[] = 'is-one-quarter-widescreen';
}else{
$column_class[] = 'is-one-third-desktop';
$column_class[] = 'is-one-third-widescreen';
}
foreach ( $attributes['imgs'] as $img ) {
$output.='<div class="'.implode(' ',$column_class).'">';
Expand Down

0 comments on commit 1e3fa97

Please sign in to comment.