Total Complexity | 5 |
Complexity/F | 1.25 |
Lines of Code | 25 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import SearchForm from './modules/SearchForm'; |
||
2 | |||
3 | (function ($) { |
||
4 | $.entwine('ss', function ($) { |
||
5 | $('#lang-editor-cms-content').entwine({ |
||
6 | onmatch: function () { |
||
7 | window.langeditor = { |
||
8 | instances: [], |
||
9 | modules: [ |
||
10 | {name: 'search-form', class: SearchForm} |
||
11 | ] |
||
12 | }; |
||
13 | |||
14 | window.langeditor.modules.forEach((item) => { |
||
15 | // try to find an element |
||
16 | let element = $(this).find(`*[data-module="${item.name}"]`); |
||
17 | |||
18 | if (element.length) { |
||
19 | window.langeditor.instances.push(new item.class(element[0])); |
||
20 | } |
||
21 | }); |
||
22 | } |
||
23 | }); |
||
24 | }); |
||
25 | })(jQuery); |