mirror of
https://github.com/BoostIo/Boostnote
synced 2026-05-31 19:53:06 +00:00
add Click & Double click handler to MarkdownPreview
This commit is contained in:
@@ -44,9 +44,17 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleClick (e) {
|
||||||
|
if (this.props.onClick) {
|
||||||
|
this.props.onClick(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
handleDoubleClick (e) {
|
handleDoubleClick (e) {
|
||||||
|
if (this.props.onDoubleClick) {
|
||||||
this.props.onDoubleClick(e)
|
this.props.onDoubleClick(e)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let isEmpty = this.props.content.trim().length === 0
|
let isEmpty = this.props.content.trim().length === 0
|
||||||
@@ -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