diff --git a/tinymce-single/tinymce/block.css b/tinymce-single/tinymce/block.css index 565d86361431fe..ee8eca873036fc 100644 --- a/tinymce-single/tinymce/block.css +++ b/tinymce-single/tinymce/block.css @@ -286,8 +286,8 @@ div.mce-inline-toolbar-grp.block-toolbar { width: 20px; }*/ -.block-toolbar .mce-btn { - margin: 0; +.block-toolbar { + margin-top: -6px; } .block-toolbar .mce-btn:hover, diff --git a/tinymce-single/tinymce/block.js b/tinymce-single/tinymce/block.js index 8c26fc85358cf1..bbc1607208e4be 100644 --- a/tinymce-single/tinymce/block.js +++ b/tinymce-single/tinymce/block.js @@ -144,9 +144,15 @@ var button = this; editor.on( 'nodechange', function( event ) { - element = event.parents[ event.parents.length - 1 ]; - - button.active( editor.$( element ).hasClass( 'align' + position ) ); + $element = editor.$( event.parents[ event.parents.length - 1 ] ); + + if ( position === 'center' ) { + button.active( ! ( + $element.hasClass( 'alignleft' ) || $element.hasClass( 'alignright' ) + ) ); + } else { + button.active( $element.hasClass( 'align' + position ) ); + } } ); } } );