Customizer: Improve IE 8 compatibility.
* Use square bracket notation for `default` keywords. * Use Underscores `indexOf` for arrays. props westonruter, ocean90. fixes #30781 for trunk. Built from https://develop.svn.wordpress.org/trunk@30991 git-svn-id: http://core.svn.wordpress.org/trunk@30973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
441b47b28f
commit
93605deef5
|
@ -128,12 +128,12 @@
|
|||
api.utils.areElementListsEqual = function ( listA, listB ) {
|
||||
var equal = (
|
||||
listA.length === listB.length && // if lists are different lengths, then naturally they are not equal
|
||||
-1 === _.map( // are there any false values in the list returned by map?
|
||||
-1 === _.indexOf( _.map( // are there any false values in the list returned by map?
|
||||
_.zip( listA, listB ), // pair up each element between the two lists
|
||||
function ( pair ) {
|
||||
return $( pair[0] ).is( pair[1] ); // compare to see if each pair are equal
|
||||
}
|
||||
).indexOf( false ) // check for presence of false in map's return value
|
||||
), false ) // check for presence of false in map's return value
|
||||
);
|
||||
return equal;
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -738,7 +738,7 @@ class WP_Customize_Upload_Control extends WP_Customize_Control {
|
|||
*/
|
||||
public function content_template() {
|
||||
?>
|
||||
<label for="{{ data.settings.default }}-button">
|
||||
<label for="{{ data.settings['default'] }}-button">
|
||||
<# if ( data.label ) { #>
|
||||
<span class="customize-control-title">{{ data.label }}</span>
|
||||
<# } #>
|
||||
|
@ -775,7 +775,7 @@ class WP_Customize_Upload_Control extends WP_Customize_Control {
|
|||
</div>
|
||||
<div class="actions">
|
||||
<button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>
|
||||
<button type="button" class="button upload-button" id="{{ data.settings.default }}-button"><?php echo $this->button_labels['change']; ?></button>
|
||||
<button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['change']; ?></button>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
<# } else { #>
|
||||
|
@ -794,7 +794,7 @@ class WP_Customize_Upload_Control extends WP_Customize_Control {
|
|||
<# if ( data.defaultAttachment ) { #>
|
||||
<button type="button" class="button default-button"><?php echo $this->button_labels['default']; ?></button>
|
||||
<# } #>
|
||||
<button type="button" class="button upload-button" id="{{ data.settings.default }}-button"><?php echo $this->button_labels['select']; ?></button>
|
||||
<button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
<# } #>
|
||||
|
|
Loading…
Reference in New Issue