Skip to content

Commit

Permalink
Merge pull request #268 from WordPress/update/tinymce-single/mock-ups
Browse files Browse the repository at this point in the history
Fix caption check on deselect
  • Loading branch information
ellatrix authored Mar 14, 2017
2 parents d2b9e82 + a356521 commit ca6a726
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tinymce-single/blocks/core/blockquote/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
function onDeselect( block ) {
var footer = block.querySelector( 'footer' );

if ( ! footer.textContent ) {
if ( footer && ! footer.textContent ) {
block.removeChild( footer );
}
}
Expand Down
2 changes: 1 addition & 1 deletion tinymce-single/blocks/core/image/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
function onDeselect( block ) {
var figcaption = block.querySelector( 'figcaption' );

if ( ! figcaption.textContent ) {
if ( figcaption && ! figcaption.textContent ) {
block.removeChild( figcaption );
}
}
Expand Down
2 changes: 1 addition & 1 deletion tinymce-single/blocks/core/table/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
function onDeselect( block ) {
var figcaption = block.querySelector( 'figcaption' );

if ( ! figcaption.textContent ) {
if ( figcaption && ! figcaption.textContent ) {
block.removeChild( figcaption );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
function onDeselect( block ) {
var figcaption = block.querySelector( 'figcaption' );

if ( ! figcaption.textContent ) {
if ( figcaption && ! figcaption.textContent ) {
block.removeChild( figcaption );
}
}
Expand Down

0 comments on commit ca6a726

Please sign in to comment.