mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
add Click & Double click handler to MarkdownPreview
This commit is contained in:
@@ -44,8 +44,16 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleClick (e) {
|
||||||
|
if (this.props.onClick) {
|
||||||
|
this.props.onClick(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
handleDoubleClick (e) {
|
handleDoubleClick (e) {
|
||||||
this.props.onDoubleClick(e)
|
if (this.props.onDoubleClick) {
|
||||||
|
this.props.onDoubleClick(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
@@ -60,6 +68,7 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MarkdownPreview.propTypes = {
|
MarkdownPreview.propTypes = {
|
||||||
|
onClick: PropTypes.func,
|
||||||
onDoubleClick: PropTypes.func,
|
onDoubleClick: PropTypes.func,
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
content: PropTypes.string
|
content: PropTypes.string
|
||||||
|
|||||||
Reference in New Issue
Block a user