Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { insertParagraphAtPos } from '../customCommands'; |
||
8 | export function initializeButtons() { |
||
9 | if (window.Prosemirror.paragraphHandlingIsInitialized) { |
||
10 | return; |
||
11 | } |
||
12 | window.Prosemirror.paragraphHandlingIsInitialized = true; |
||
13 | jQuery(document).on('click', '.ProseMirror button.addParagraphButton', function insertParagraph(event) { |
||
14 | event.stopPropagation(); |
||
15 | event.preventDefault(); |
||
16 | const $button = jQuery(this); |
||
17 | const viewID = $button.data('viewid'); |
||
18 | const direction = $button.data('direction'); |
||
19 | const view = window.Prosemirror.views[viewID]; |
||
20 | |||
21 | const pos = view.posAtDOM(event.target.parentNode); |
||
22 | const command = insertParagraphAtPos(pos, direction); |
||
23 | command(view.state, view.dispatch); |
||
24 | }); |
||
25 | } |
||
26 | |||
50 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.