| Total Complexity | 3 |
| Complexity/F | 1.5 |
| Lines of Code | 16 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | wp.customize.controlConstructor['kirki-switch'] = wp.customize.kirkiDynamicControl.extend({ |
||
| 2 | |||
| 3 | initKirkiControl: function() { |
||
| 4 | |||
| 5 | 'use strict'; |
||
| 6 | |||
| 7 | var control = this, |
||
| 8 | checkboxValue = control.setting._value; |
||
| 9 | |||
| 10 | // Save the value |
||
| 11 | this.container.on( 'change', 'input', function() { |
||
| 12 | checkboxValue = ( jQuery( this ).is( ':checked' ) ) ? true : false; |
||
| 13 | control.setting.set( checkboxValue ); |
||
| 14 | }); |
||
| 15 | } |
||
| 16 | }); |
||
| 17 |