Skip to content

Commit

Permalink
Merge pull request #132 from WordPress/fix-tinymce-single-issues
Browse files Browse the repository at this point in the history
Fix tinymce single issues
  • Loading branch information
ellatrix authored Feb 24, 2017
2 parents 0319274 + 574120f commit f04817c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tinymce-single/tinymce/block.css
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 9 additions & 3 deletions tinymce-single/tinymce/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
}
} );
}
} );
Expand Down

0 comments on commit f04817c

Please sign in to comment.