Skip to content

Commit

Permalink
fix pb button
Browse files Browse the repository at this point in the history
  • Loading branch information
NickLaiacona committed Mar 18, 2020
1 parent fad02e7 commit c83263d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/EditorToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ export default class EditorToolbar extends Component {
}
}

createPbHandler( pbNode, editorView ) {
createPbHandler( editorView ) {
return () => {
const { state } = editorView
const { tr, selection } = state
const { $anchor } = selection
const pbNode = state.schema.node('pb')
tr.insert($anchor.pos, pbNode)
editorView.dispatch(tr)
editorView.focus()
Expand Down Expand Up @@ -178,7 +179,7 @@ export default class EditorToolbar extends Component {
break
}
case 'pb': {
const onClick = this.createPbHandler( schema.nodes['pb'], editorView )
const onClick = this.createPbHandler( editorView )
groupButtons.push( this.renderButton(element.name, onClick) )
break
}
Expand Down

0 comments on commit c83263d

Please sign in to comment.