diff --git a/tinymce-single/tinymce/block.js b/tinymce-single/tinymce/block.js index 7a2fe6cc30d242..0961dcd4c858ff 100644 --- a/tinymce-single/tinymce/block.js +++ b/tinymce-single/tinymce/block.js @@ -348,7 +348,7 @@ if ( settings ) { if ( ! blockToolbars[ settings._id ] ) { - blockToolbars[ settings._id ] = editor.wp._createToolbar( settings.buttons.concat( [ 'block-remove' ] ) ); + blockToolbars[ settings._id ] = editor.wp._createToolbar( settings.buttons ); blockToolbars[ settings._id ].reposition = function () { if (!element) return @@ -553,6 +553,24 @@ event.preventDefault(); } } + } else { + if ( keyCode === VK.BACKSPACE ) { + var selection = window.getSelection(); + + if ( ! selection.isCollapsed && editor.dom.isBlock( selection.focusNode ) ) { + if ( selection.anchorOffset === 0 && selection.focusOffset === 0 ) { + if ( element.nextSibling && element.nextSibling.contains( selection.focusNode ) ) { + removeBlock(); + event.preventDefault(); + } + } + + if ( selection.anchorOffset === 0 && selection.anchorNode === selection.focusNode ) { + removeBlock(); + event.preventDefault(); + } + } + } } if ( VK.metaKeyPressed( event ) ) {