Conditions | 7 |
Paths | 6 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | /** |
||
32 | function clickDialogBtn(dgBtn = 'ok', idx = null) { |
||
33 | let selector = (dgBtn === 'ok') ? '.dg-btn--ok' : '.dg-btn--cancel' |
||
34 | let node, nodes = getElem(selector, true) |
||
35 | |||
36 | if (nodes.length > 0) { |
||
37 | if (idx === null) { |
||
38 | // click the last |
||
39 | clickNode(nodes[nodes.length - 1]) |
||
40 | } else if (idx === true) { |
||
41 | // click all |
||
42 | for (let i = 0; i < nodes.length; i++) { |
||
43 | clickNode(nodes[i]) |
||
44 | } |
||
45 | } else if (node = nodes[parseInt(idx)]) { |
||
46 | // click at index |
||
47 | clickNode(node) |
||
48 | } |
||
49 | } |
||
50 | } |
||
51 |