-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EZEE-2914: Custom inline style does not update textarea after click on (
- Loading branch information
1 parent
d12bdeb
commit 8728a0b
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-styleslistitem.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import AlloyEditor from 'alloyeditor'; | ||
|
||
export default class EzBtnStylesListItem extends AlloyEditor.ButtonStylesListItem { | ||
/** | ||
* Lifecycle. Renders the UI of the button. | ||
* | ||
* @instance | ||
* @memberof ButtonStylesListItem | ||
* @method render | ||
* @return {Object} The content which should be rendered. | ||
*/ | ||
render() { | ||
const className = this.props.name === this.props.activeStyle ? 'ae-toolbar-element active' : 'ae-toolbar-element'; | ||
|
||
return ( | ||
<button | ||
className={className} | ||
dangerouslySetInnerHTML={{ __html: this._preview }} | ||
onClick={() => { | ||
this._onClick(); | ||
this.fireCustomUpdateEvent(); | ||
}} | ||
tabIndex={this.props.tabIndex} | ||
/> | ||
); | ||
} | ||
|
||
fireCustomUpdateEvent() { | ||
const nativeEditor = this.props.editor.get('nativeEditor'); | ||
|
||
nativeEditor.fire('customUpdate'); | ||
} | ||
} | ||
|
||
AlloyEditor.ButtonStylesListItem = AlloyEditor.EzBtnStylesListItem = EzBtnStylesListItem; | ||
eZ.addConfig('ezAlloyEditor.ezBtnStylesListItem', EzBtnStylesListItem); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters