Skip to content

Commit

Permalink
Apply changed style to TinyMCE node
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jun 7, 2017
1 parent 311582e commit ad06c61
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions blocks/editable/tinymce.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import tinymce from 'tinymce';
import { isEqual } from 'lodash';

export default class TinyMCE extends wp.element.Component {
componentDidMount() {
Expand All @@ -22,6 +23,10 @@ export default class TinyMCE extends wp.element.Component {
if ( this.editorNode.getAttribute( 'data-is-empty' ) !== isEmpty ) {
this.editorNode.setAttribute( 'data-is-empty', isEmpty );
}

if ( ! isEqual( this.props.style, nextProps.style ) ) {
Object.assign( this.editorNode.style, nextProps.style );
}
}

componentWillUnmount() {
Expand Down

0 comments on commit ad06c61

Please sign in to comment.