From a62d96c77762a4cbddd61020a03795f7050c8cf6 Mon Sep 17 00:00:00 2001 From: iseulde Date: Fri, 24 Feb 2017 10:36:52 +0100 Subject: [PATCH 1/2] Move block/new icons higher again after 00cf814c3dbbe6bcc2bb58cf7e8d2a7170645340 --- tinymce-single/tinymce/block.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, From 574120f711ff748fd3e1a9f09676abf00d48649a Mon Sep 17 00:00:00 2001 From: iseulde Date: Fri, 24 Feb 2017 10:51:59 +0100 Subject: [PATCH 2/2] tinymce-single: set active button for default alignment --- tinymce-single/tinymce/block.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 ) ); + } } ); } } );