1 | 'use strict';
|
2 |
|
3 | var decreaseItemDepth = require('./changes/decreaseItemDepth');
|
4 | var increaseItemDepth = require('./changes/increaseItemDepth');
|
5 | var getCurrentItem = require('./getCurrentItem');
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | function onTab(event, change, editor, opts) {
|
13 | var value = change.value;
|
14 | var isCollapsed = value.isCollapsed;
|
15 |
|
16 |
|
17 | if (!isCollapsed || !getCurrentItem(opts, value)) {
|
18 | return;
|
19 | }
|
20 |
|
21 |
|
22 | if (event.shiftKey) {
|
23 | event.preventDefault();
|
24 |
|
25 | return decreaseItemDepth(opts, change);
|
26 | }
|
27 |
|
28 |
|
29 | event.preventDefault();
|
30 |
|
31 | return increaseItemDepth(opts, change);
|
32 | }
|
33 |
|
34 | module.exports = onTab; |
\ | No newline at end of file |