Total Complexity | 9 |
Complexity/F | 4.5 |
Lines of Code | 30 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 1 |
1 | import { editRow } from './../actions/plugins/editor/EditorActions'; |
||
2 | |||
3 | export const handleEditClick = ( |
||
4 | editor, |
||
5 | store, |
||
6 | rowId, |
||
7 | rowData, |
||
8 | rowIndex, |
||
9 | columns, |
||
10 | stateKey, |
||
11 | events = {}, |
||
12 | data, |
||
13 | ) => { |
||
14 | |||
15 | if (events.HANDLE_BEFORE_EDIT) { |
||
16 | const result = events.HANDLE_BEFORE_EDIT({ |
||
17 | store, |
||
18 | id: rowId, |
||
19 | data: rowData |
||
20 | }); |
||
21 | |||
22 | // if HANDLE_BEFORE_EDIT event returns false |
||
23 | // do not trigger edit |
||
24 | if (result === false) { |
||
25 | return; |
||
26 | } |
||
27 | } |
||
28 | |||
29 | const row = closestRow(data.reactEvent.target); |
||
30 | const offset = 7; |
||
31 | const top = row ? |
||
54 |