mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 12:43:52 +08:00
Simplify some code in MarkdownButton component
This commit is contained in:
parent
50a4530cfc
commit
f4e250f514
|
@ -14,7 +14,7 @@ export default class MarkdownButton extends Component {
|
|||
view() {
|
||||
return <button className="Button Button--icon Button--link" title={this.title()} data-hotkey={this.props.hotkey}
|
||||
onclick={this.click.bind(this)} onkeydown={this.keydown.bind(this)}>
|
||||
{icon(this.icon())}
|
||||
{icon(this.props.icon)}
|
||||
</button>;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ export default class MarkdownButton extends Component {
|
|||
}
|
||||
|
||||
click() {
|
||||
return apply(this.element, this.styles());
|
||||
return apply(this.element, this.props.style);
|
||||
}
|
||||
|
||||
title() {
|
||||
|
@ -36,12 +36,4 @@ export default class MarkdownButton extends Component {
|
|||
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
icon() {
|
||||
return this.props.icon;
|
||||
}
|
||||
|
||||
styles() {
|
||||
return this.props.style;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user