Total Complexity | 5 |
Complexity/F | 1.25 |
Lines of Code | 25 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | var $ = window.jQuery; |
||
2 | |||
3 | exports.settings = { |
||
4 | haveBeenModified: false, |
||
5 | init: function() { |
||
6 | $('.amarkal-ui-component').on('amarkal.change',function(e, component){ |
||
7 | Amarkal.settings.notifier.notice("Settings have changed, click \"Save\" to apply them."); |
||
|
|||
8 | Amarkal.settings.sections.flag('notice', component.props.section); |
||
9 | Amarkal.settings.fields.flag('notice', component.props.name); |
||
10 | Amarkal.settings.haveBeenModified = true; |
||
11 | }); |
||
12 | $(window).on('beforeunload',function(){ |
||
13 | if(Amarkal.settings.haveBeenModified) { |
||
14 | return 'Are you sure you want to leave this page?'; |
||
15 | } |
||
16 | }); |
||
17 | Amarkal.settings.fields.init(); |
||
18 | Amarkal.settings.search.init(); |
||
19 | Amarkal.settings.sections.init(); |
||
20 | } |
||
21 | }; |
||
22 | |||
23 | $(document).ready(function(){ |
||
24 | Amarkal.settings.init(); |
||
25 | }); |
||
26 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.