Skip to content

Commit

Permalink
Replace all instances of blocks-gallery-image
Browse files Browse the repository at this point in the history
  • Loading branch information
Joen Asmussen committed Jan 18, 2018
1 parent 4466445 commit 3da0798
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions blocks/library/gallery/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
}
}

.blocks-gallery-image__inline-menu {
.blocks-gallery-item__inline-menu {
padding: 2px;
position: absolute;
top: 0;
right: 0;
background-color: $blue-medium-500;
display: inline-flex;
z-index: z-index( '.blocks-gallery-image__inline-menu' );
z-index: z-index( '.blocks-gallery-item__inline-menu' );

.components-button {
color: $white;
Expand All @@ -29,6 +29,6 @@
}
}

.blocks-gallery-image__remove {
.blocks-gallery-item__remove {
padding: 0;
}
4 changes: 2 additions & 2 deletions blocks/library/gallery/gallery-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ class GalleryImage extends Component {
return (
<figure className={ className } onClick={ onClick }>
{ isSelected &&
<div className="blocks-gallery-image__inline-menu">
<div className="blocks-gallery-item__inline-menu">
<IconButton
icon="no-alt"
onClick={ onRemove }
className="blocks-gallery-image__remove"
className="blocks-gallery-item__remove"
label={ __( 'Remove Image' ) }
/>
</div>
Expand Down
6 changes: 3 additions & 3 deletions blocks/library/gallery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ registerBlockType( 'core/gallery', {
type: 'array',
default: [],
source: 'query',
selector: 'ul.wp-block-gallery .blocks-gallery-image img',
selector: 'ul.wp-block-gallery .blocks-gallery-item img',
query: {
url: {
source: 'attribute',
Expand Down Expand Up @@ -167,7 +167,7 @@ registerBlockType( 'core/gallery', {
const img = <img src={ image.url } alt={ image.alt } data-id={ image.id } />;

return (
<li key={ image.id || image.url } className="blocks-gallery-image">
<li key={ image.id || image.url } className="blocks-gallery-item">
<figure>
{ href ? <a href={ href }>{ img }</a> : img }
</figure>
Expand Down Expand Up @@ -199,7 +199,7 @@ registerBlockType( 'core/gallery', {
const img = <img src={ image.url } alt={ image.alt } data-id={ image.id } />;

return (
<li key={ image.id || image.url } className="blocks-gallery-image">
<li key={ image.id || image.url } className="blocks-gallery-item">
<figure>
{ href ? <a href={ href }>{ img }</a> : img }
</figure>
Expand Down
4 changes: 2 additions & 2 deletions blocks/test/fixtures/core__gallery.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- wp:core/gallery -->
<ul class="wp-block-gallery alignnone columns-2 is-cropped">
<li class="blocks-gallery-image">
<li class="blocks-gallery-item">
<figure>
<img src="https://cldup.com/uuUqE_dXzy.jpg" alt="title" />
</figure>
</li>
<li class="blocks-gallery-image">
<li class="blocks-gallery-item">
<figure>
<img src="http://google.com/hi.png" alt="title" />
</figure>
Expand Down
4 changes: 2 additions & 2 deletions blocks/test/fixtures/core__gallery.serialized.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- wp:gallery -->
<ul class="wp-block-gallery alignnone columns-2 is-cropped">
<li class="blocks-gallery-image">
<li class="blocks-gallery-item">
<figure>
<img src="https://cldup.com/uuUqE_dXzy.jpg" alt="title" />
</figure>
</li>
<li class="blocks-gallery-image">
<li class="blocks-gallery-item">
<figure>
<img src="http://google.com/hi.png" alt="title" />
</figure>
Expand Down
2 changes: 1 addition & 1 deletion editor/assets/stylesheets/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $z-layers: (
'.editor-block-switcher__menu': 2,
'.components-popover__close': 2,
'.editor-block-mover': 1,
'.blocks-gallery-image__inline-menu': 20,
'.blocks-gallery-item__inline-menu': 20,
'.editor-block-settings-menu__popover': 20, // Below the header
'.editor-header': 30,
'.editor-text-editor__formatting': 30,
Expand Down
10 changes: 5 additions & 5 deletions phpunit/fixtures/long-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ <h2>Visual Editing</h2>
<!-- /wp:paragraph -->
<!-- wp:gallery {"columns":2} -->
<div class="wp-block-gallery alignnone columns-2 is-cropped">
<figure class="blocks-gallery-image"><img src="https://cldup.com/n0g6ME5VKC.jpg" alt="" /></figure>
<figure class="blocks-gallery-image"><img src="https://cldup.com/ZjESfxPI3R.jpg" alt="" /></figure>
<figure class="blocks-gallery-image"><img src="https://cldup.com/EKNF8xD2UM.jpg" alt="" /></figure>
<figure class="blocks-gallery-item"><img src="https://cldup.com/n0g6ME5VKC.jpg" alt="" /></figure>
<figure class="blocks-gallery-item"><img src="https://cldup.com/ZjESfxPI3R.jpg" alt="" /></figure>
<figure class="blocks-gallery-item"><img src="https://cldup.com/EKNF8xD2UM.jpg" alt="" /></figure>
</div>
<!-- /wp:gallery -->
<!-- wp:paragraph -->
Expand All @@ -89,8 +89,8 @@ <h2>Media Rich</h2>
<!-- /wp:paragraph -->
<!-- wp:gallery {"align":"wide"} -->
<div class="wp-block-gallery alignwide columns-2 is-cropped">
<figure class="blocks-gallery-image"><img src="https://cldup.com/_rSwtEeDGD.jpg" alt="" /></figure>
<figure class="blocks-gallery-image"><img src="https://cldup.com/L-cC3qX2DN.jpg" alt="" /></figure>
<figure class="blocks-gallery-item"><img src="https://cldup.com/_rSwtEeDGD.jpg" alt="" /></figure>
<figure class="blocks-gallery-item"><img src="https://cldup.com/L-cC3qX2DN.jpg" alt="" /></figure>
</div>
<!-- /wp:gallery -->
<!-- wp:paragraph -->
Expand Down
6 changes: 3 additions & 3 deletions post-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ window._wpGutenbergPost.content = {

'<!-- wp:gallery {"columns":2} -->',
'<ul class="wp-block-gallery alignnone columns-2 is-cropped">',
'<li class="blocks-gallery-image"><figure><img src="https://cldup.com/n0g6ME5VKC.jpg" alt="" /></figure></li>',
'<li class="blocks-gallery-image"><figure><img src="https://cldup.com/ZjESfxPI3R.jpg" alt="" /></figure></li>',
'<li class="blocks-gallery-image"><figure><img src="https://cldup.com/EKNF8xD2UM.jpg" alt="" /></figure></li>',
'<li class="blocks-gallery-item"><figure><img src="https://cldup.com/n0g6ME5VKC.jpg" alt="" /></figure></li>',
'<li class="blocks-gallery-item"><figure><img src="https://cldup.com/ZjESfxPI3R.jpg" alt="" /></figure></li>',
'<li class="blocks-gallery-item"><figure><img src="https://cldup.com/EKNF8xD2UM.jpg" alt="" /></figure></li>',
'</ul>',
'<!-- /wp:gallery -->',

Expand Down

0 comments on commit 3da0798

Please sign in to comment.