1 | /* global kirkiSetSettingValue */ |
||
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
2 | jQuery( document ).ready( function() { |
||
0 ignored issues
–
show
|
|||
3 | |||
4 | // Loop Controls. |
||
5 | wp.customize.control.each( function( control ) { |
||
0 ignored issues
–
show
|
|||
6 | |||
7 | // Check if we have a preset defined. |
||
8 | if ( control.params && control.params.preset && ! _.isEmpty( control.params.preset ) ) { |
||
9 | wp.customize( control.id, function( value ) { |
||
0 ignored issues
–
show
|
|||
10 | |||
11 | // Listen to value changes. |
||
12 | value.bind( function( to ) { |
||
0 ignored issues
–
show
|
|||
13 | |||
14 | // Loop preset definitions. |
||
15 | _.each( control.params.preset, function( preset, valueToListen ) { |
||
0 ignored issues
–
show
|
|||
16 | |||
17 | // Check if the value set want is the same as the one we're looking for. |
||
18 | if ( valueToListen === to ) { |
||
19 | |||
20 | // Loop settings defined inside the preset. |
||
21 | _.each( preset.settings, function( controlValue, controlID ) { |
||
0 ignored issues
–
show
|
|||
22 | |||
23 | // Set the value. |
||
24 | kirkiSetSettingValue.set( controlID, controlValue ); |
||
25 | } ); |
||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||
26 | } |
||
27 | } ); |
||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||
28 | } ); |
||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||
29 | } ); |
||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||
30 | } |
||
31 | } ); |
||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||
32 | } ); |
||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||
33 |