Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
fix(FormattingToolbar): fix history buttons
Browse files Browse the repository at this point in the history
Signed-off-by: irmerk <[email protected]>
  • Loading branch information
jolanglinais committed Mar 12, 2020
1 parent c277236 commit 4b89ac9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@
"slate-plain-serializer": "^0.7.11",
"style-loader": "^0.23.1"
}
}
}
10 changes: 5 additions & 5 deletions src/FormattingToolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ export default class FormatToolbar extends React.Component {
/**
* Render a history-toggling toolbar button.
*/
renderHistoryButton(type, icon, hi, wi, pa, vBox, action, classInput) {
renderHistoryButton(type, label, icon, hi, wi, pa, vBox, classInput) {
const { editor, editorProps } = this.props;

const style = {
Expand All @@ -516,7 +516,7 @@ export default class FormatToolbar extends React.Component {

return (
<Popup
content={tips.capitalizeWord(action)}
content={label}
style={style}
position='bottom center'
trigger={
Expand All @@ -528,7 +528,7 @@ export default class FormatToolbar extends React.Component {
padding={pa}
viewBox={vBox}
className={classInput}
onClick={event => this.onClickHistory(event, action, editor)}>
onClick={event => this.onClickHistory(event, type, editor)}>
{icon(styles.buttonSymbolInactive(editorProps.BUTTON_SYMBOL_INACTIVE))}
</ ToolbarIcon>
}
Expand Down Expand Up @@ -674,24 +674,24 @@ export default class FormatToolbar extends React.Component {
{
this.renderHistoryButton(
undoIcon.type(),
undoIcon.label(),
undoIcon.icon,
undoIcon.height(),
undoIcon.width(),
undoIcon.padding(),
undoIcon.vBox(),
`Undo (${tips.MOD}+Z)`,
'toolbar-2x2'
)
}
{
this.renderHistoryButton(
redoIcon.type(),
undoIcon.label(),
redoIcon.icon,
redoIcon.height(),
redoIcon.width(),
redoIcon.padding(),
redoIcon.vBox(),
`Redo (${tips.MOD}+Y)`,
'toolbar-2x3'
)
}
Expand Down
4 changes: 4 additions & 0 deletions src/icons/navigation-left.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react';

import * as tips from '../FormattingToolbar/toolbarTooltip';

export const type = () => 'undo';

export const label = () => `Undo (${tips.MOD}+Z)`;

export const height = () => '25px';

export const width = () => '25px';
Expand Down
4 changes: 4 additions & 0 deletions src/icons/navigation-right.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react';

import * as tips from '../FormattingToolbar/toolbarTooltip';

export const type = () => 'redo';

export const label = () => `Redo (${tips.MOD}+Y)`;

export const height = () => '25px';

export const width = () => '25px';
Expand Down

0 comments on commit 4b89ac9

Please sign in to comment.