| Conditions | 9 |
| Paths | 6 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | export default function recursiveFolder(obj, index = 1, dataShow = '', links = null, visible = false) { |
||
| 20 | Array.prototype.forEach.call(obj, (o) => { |
||
| 21 | var selected = '' |
||
| 22 | var isVisible = false |
||
| 23 | if(typeof links !== 'undefined' && links !== null && |
||
| 24 | typeof links[index - 1] !== 'undefined' && links[index - 1] !== null) { |
||
| 25 | if (links[index - 1] === o.name) { |
||
| 26 | selected = 'selected="selected"' |
||
| 27 | isVisible = true |
||
| 28 | } |
||
| 29 | } |
||
| 30 | res += `<option ${selected} data-level-hide="${index+2}" data-level-show="${index+1}" data-show="${o.name.replace(/\.| |\#/g, '_')}">${o.name}</option>` |
||
| 31 | |||
| 32 | if(typeof o.folders !== 'undefined' && o.folders !== null && o.folders.length > 0) { |
||
| 33 | sub += recursiveFolder(o.folders, index+1, o.name.replace(/\.| |\#/g, '_'), links, isVisible) |
||
| 34 | } |
||
| 35 | }) |
||
| 36 | |||
| 45 |