updated theme GeneratePress
version 3.2.0
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -1,142 +1,142 @@
|
||||
.customize-control-generatepress-range-slider .generatepress-slider {
|
||||
position: relative;
|
||||
width: calc(100% - 60px);
|
||||
height: 6px;
|
||||
background-color: rgba(0,0,0,.10);
|
||||
cursor: pointer;
|
||||
-webkit-transition: background .5s;
|
||||
-moz-transition: background .5s;
|
||||
transition: background .5s;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .generatepress-slider {
|
||||
width: calc(100% - 90px);
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value.hide-value {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value.hide-value + .generatepress-slider {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .generatepress-slider .ui-slider-handle {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
background-color: #3498D9;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
-webkit-transform: translateY(-50%) translateX(-4px);
|
||||
transform: translateY(-50%) translateX(-4px);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.gp-range-title-area {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.gp-range-slider-controls {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .wrapper {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value {
|
||||
font-size: 14px;
|
||||
padding: 0;
|
||||
font-weight: 400;
|
||||
width: 50px;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value span.value {
|
||||
font-size: 12px;
|
||||
width: calc(100% - 2px);
|
||||
text-align: center;
|
||||
min-height: 30px;
|
||||
background: #FFF;
|
||||
line-height: 30px;
|
||||
border: 1px solid #DDD;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value span.value {
|
||||
width: calc(100% - 32px);
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value .unit {
|
||||
width: 29px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .generatepress-range-slider-reset span {
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value input {
|
||||
font-size: 12px;
|
||||
padding: 0px;
|
||||
text-align: center;
|
||||
min-height: 30px;
|
||||
height: auto;
|
||||
border-radius: 0;
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value input {
|
||||
width: calc(100% - 30px);
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons {
|
||||
cursor: pointer;
|
||||
font-size: 11px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
color: #222;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons:hover {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons.selected {
|
||||
background: #fff;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-device-controls > span:first-child:last-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .sub-description {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.customize-control-generatepress-range-slider .generatepress-slider {
|
||||
position: relative;
|
||||
width: calc(100% - 60px);
|
||||
height: 6px;
|
||||
background-color: rgba(0,0,0,.10);
|
||||
cursor: pointer;
|
||||
-webkit-transition: background .5s;
|
||||
-moz-transition: background .5s;
|
||||
transition: background .5s;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .generatepress-slider {
|
||||
width: calc(100% - 90px);
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value.hide-value {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value.hide-value + .generatepress-slider {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .generatepress-slider .ui-slider-handle {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
background-color: #3498D9;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
-webkit-transform: translateY(-50%) translateX(-4px);
|
||||
transform: translateY(-50%) translateX(-4px);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.gp-range-title-area {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.gp-range-slider-controls {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .wrapper {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value {
|
||||
font-size: 14px;
|
||||
padding: 0;
|
||||
font-weight: 400;
|
||||
width: 50px;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value span.value {
|
||||
font-size: 12px;
|
||||
width: calc(100% - 2px);
|
||||
text-align: center;
|
||||
min-height: 30px;
|
||||
background: #FFF;
|
||||
line-height: 30px;
|
||||
border: 1px solid #DDD;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value span.value {
|
||||
width: calc(100% - 32px);
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value .unit {
|
||||
width: 29px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .generatepress-range-slider-reset span {
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value input {
|
||||
font-size: 12px;
|
||||
padding: 0px;
|
||||
text-align: center;
|
||||
min-height: 30px;
|
||||
height: auto;
|
||||
border-radius: 0;
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value input {
|
||||
width: calc(100% - 30px);
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons {
|
||||
cursor: pointer;
|
||||
font-size: 11px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
color: #222;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons:hover {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons.selected {
|
||||
background: #fff;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-device-controls > span:first-child:last-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .sub-description {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
@ -1,47 +1,47 @@
|
||||
.generatepress-font-family {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.generatepress-weight-transform-wrapper {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.generatepress-font-weight,
|
||||
.generatepress-font-transform {
|
||||
width: calc(50% - 5px);
|
||||
}
|
||||
|
||||
span.select2-container.select2-container--default.select2-container--open li.select2-results__option {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
span.select2-container.select2-container--default.select2-container--open{
|
||||
z-index:999999;
|
||||
}
|
||||
|
||||
.select2-selection__rendered li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single,
|
||||
.select2-container--default.select2-container .select2-selection--multiple,
|
||||
.select2-dropdown,
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
border-color: #ddd;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-results__option[aria-selected=true] {
|
||||
color: rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
#customize-control-font_heading_1_control,
|
||||
#customize-control-font_heading_2_control,
|
||||
#customize-control-font_heading_3_control {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.generatepress-font-family {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.generatepress-weight-transform-wrapper {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.generatepress-font-weight,
|
||||
.generatepress-font-transform {
|
||||
width: calc(50% - 5px);
|
||||
}
|
||||
|
||||
span.select2-container.select2-container--default.select2-container--open li.select2-results__option {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
span.select2-container.select2-container--default.select2-container--open{
|
||||
z-index:999999;
|
||||
}
|
||||
|
||||
.select2-selection__rendered li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single,
|
||||
.select2-container--default.select2-container .select2-selection--multiple,
|
||||
.select2-dropdown,
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
border-color: #ddd;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-results__option[aria-selected=true] {
|
||||
color: rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
#customize-control-font_heading_1_control,
|
||||
#customize-control-font_heading_2_control,
|
||||
#customize-control-font_heading_3_control {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
@ -499,4 +499,24 @@ function generatepress_typography_live_update( id, selector, property, unit, med
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
wp.customize( 'generate_settings[global_colors]', function( value ) {
|
||||
value.bind( function( newval ) {
|
||||
var globalColors = '';
|
||||
|
||||
newval.forEach( function( item ) {
|
||||
globalColors += '--' + item.slug + ':' + item.color + ';';
|
||||
} );
|
||||
|
||||
if ( $( 'style#global_colors' ).length ) {
|
||||
$( 'style#global_colors' ).html( ':root{' + globalColors + '}' );
|
||||
} else {
|
||||
$( 'head' ).append( '<style id="global_colors">:root{' + globalColors + '}</style>' );
|
||||
|
||||
setTimeout( function() {
|
||||
$( 'style#global_colors' ).not( ':last' ).remove();
|
||||
}, 100 );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
}( jQuery ) );
|
||||
|
@ -1,154 +1,154 @@
|
||||
( function( api ) {
|
||||
|
||||
api.controlConstructor['gp-customizer-typography'] = api.Control.extend( {
|
||||
ready: function() {
|
||||
var control = this;
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-family select',
|
||||
function() {
|
||||
var _this = jQuery( this ),
|
||||
_value = _this.val(),
|
||||
_categoryID = _this.attr( 'data-category' ),
|
||||
_variantsID = _this.attr( 'data-variants' );
|
||||
|
||||
// Set our font family
|
||||
control.settings['family'].set( _this.val() );
|
||||
|
||||
// Bail if our controls don't exist
|
||||
if ( 'undefined' == typeof control.settings['category'] || 'undefined' == typeof control.settings['variant'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout( function() {
|
||||
// Send our request to the generate_get_all_google_fonts_ajax function
|
||||
var response = jQuery.getJSON({
|
||||
type: 'POST',
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'generate_get_all_google_fonts_ajax',
|
||||
gp_customize_nonce: gp_customize.nonce
|
||||
},
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
});
|
||||
|
||||
// Get our response
|
||||
var fonts = response.responseJSON;
|
||||
|
||||
// Create an ID from our selected font
|
||||
var id = _value.split(' ').join('_').toLowerCase();
|
||||
|
||||
// Set our values if we have them
|
||||
if ( id in fonts ) {
|
||||
|
||||
// Get existing variants if this font is already selected
|
||||
var got_variants = false;
|
||||
jQuery( '.generatepress-font-family select' ).not( _this ).each( function( key, select ) {
|
||||
var parent = jQuery( this ).closest( '.generatepress-font-family' );
|
||||
|
||||
if ( _value == jQuery( select ).val() && _this.data( 'category' ) !== jQuery( select ).data( 'category' ) ) {
|
||||
if ( ! got_variants ) {
|
||||
updated_variants = jQuery( parent.next( '.generatepress-font-variant' ).find( 'select' ) ).val();
|
||||
got_variants = true;
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
// We're using a Google font, so show the variants field
|
||||
_this.closest( '.generatepress-font-family' ).next( 'div' ).show();
|
||||
|
||||
// Remove existing variants
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove();
|
||||
|
||||
// Populate our select input with available variants
|
||||
jQuery.each( fonts[ id ].variants, function( key, value ) {
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).append( jQuery( '<option></option>' ).attr( 'value', value ).text( value ) );
|
||||
} );
|
||||
|
||||
// Set our variants
|
||||
if ( ! got_variants ) {
|
||||
control.settings[ 'variant' ].set( fonts[ id ].variants );
|
||||
} else {
|
||||
control.settings[ 'variant' ].set( updated_variants );
|
||||
}
|
||||
|
||||
// Set our font category
|
||||
control.settings[ 'category' ].set( fonts[ id ].category );
|
||||
jQuery( 'input[name="' + _categoryID + '"' ).val( fonts[ id ].category );
|
||||
} else {
|
||||
_this.closest( '.generatepress-font-family' ).next( 'div' ).hide();
|
||||
control.settings[ 'category' ].set( '' )
|
||||
control.settings[ 'variant' ].set( '' )
|
||||
jQuery( 'input[name="' + _categoryID + '"' ).val( '' );
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove();
|
||||
}
|
||||
}, 25 );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-variant select',
|
||||
function() {
|
||||
var _this = jQuery( this );
|
||||
var variants = _this.val();
|
||||
|
||||
control.settings['variant'].set( variants );
|
||||
|
||||
jQuery( '.generatepress-font-variant select' ).each( function( key, value ) {
|
||||
var this_control = jQuery( this ).closest( 'li' ).attr( 'id' ).replace( 'customize-control-', '' );
|
||||
var parent = jQuery( this ).closest( '.generatepress-font-variant' );
|
||||
var font_val = api.control( this_control ).settings['family'].get();
|
||||
|
||||
if ( font_val == control.settings['family'].get() && _this.attr( 'name' ) !== jQuery( value ).attr( 'name' ) ) {
|
||||
jQuery( parent.find( 'select' ) ).not( _this ).val( variants ).triggerHandler( 'change' );
|
||||
api.control( this_control ).settings['variant'].set( variants );
|
||||
}
|
||||
} );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-category input',
|
||||
function() {
|
||||
control.settings['category'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-weight select',
|
||||
function() {
|
||||
control.settings['weight'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-transform select',
|
||||
function() {
|
||||
control.settings['transform'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
} );
|
||||
|
||||
} )( wp.customize );
|
||||
|
||||
jQuery( document ).ready( function( $ ) {
|
||||
|
||||
$( '.generatepress-font-family select' ).select2();
|
||||
|
||||
$( '.generatepress-font-variant' ).each( function( key, value ) {
|
||||
var _this = $( this );
|
||||
var value = _this.data( 'saved-value' );
|
||||
|
||||
if ( value ) {
|
||||
value = value.toString().split( ',' );
|
||||
}
|
||||
|
||||
_this.find( 'select' ).select2().val( value ).trigger( 'change.select2' );
|
||||
} );
|
||||
|
||||
$( ".generatepress-font-family" ).each( function( key, value ) {
|
||||
var _this = $( this );
|
||||
if ( $.inArray( _this.find( 'select' ).val(), typography_defaults ) !== -1 ) {
|
||||
_this.next( '.generatepress-font-variant' ).hide();
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
||||
( function( api ) {
|
||||
|
||||
api.controlConstructor['gp-customizer-typography'] = api.Control.extend( {
|
||||
ready: function() {
|
||||
var control = this;
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-family select',
|
||||
function() {
|
||||
var _this = jQuery( this ),
|
||||
_value = _this.val(),
|
||||
_categoryID = _this.attr( 'data-category' ),
|
||||
_variantsID = _this.attr( 'data-variants' );
|
||||
|
||||
// Set our font family
|
||||
control.settings['family'].set( _this.val() );
|
||||
|
||||
// Bail if our controls don't exist
|
||||
if ( 'undefined' == typeof control.settings['category'] || 'undefined' == typeof control.settings['variant'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout( function() {
|
||||
// Send our request to the generate_get_all_google_fonts_ajax function
|
||||
var response = jQuery.getJSON({
|
||||
type: 'POST',
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'generate_get_all_google_fonts_ajax',
|
||||
gp_customize_nonce: gp_customize.nonce
|
||||
},
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
});
|
||||
|
||||
// Get our response
|
||||
var fonts = response.responseJSON;
|
||||
|
||||
// Create an ID from our selected font
|
||||
var id = _value.split(' ').join('_').toLowerCase();
|
||||
|
||||
// Set our values if we have them
|
||||
if ( id in fonts ) {
|
||||
|
||||
// Get existing variants if this font is already selected
|
||||
var got_variants = false;
|
||||
jQuery( '.generatepress-font-family select' ).not( _this ).each( function( key, select ) {
|
||||
var parent = jQuery( this ).closest( '.generatepress-font-family' );
|
||||
|
||||
if ( _value == jQuery( select ).val() && _this.data( 'category' ) !== jQuery( select ).data( 'category' ) ) {
|
||||
if ( ! got_variants ) {
|
||||
updated_variants = jQuery( parent.next( '.generatepress-font-variant' ).find( 'select' ) ).val();
|
||||
got_variants = true;
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
// We're using a Google font, so show the variants field
|
||||
_this.closest( '.generatepress-font-family' ).next( 'div' ).show();
|
||||
|
||||
// Remove existing variants
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove();
|
||||
|
||||
// Populate our select input with available variants
|
||||
jQuery.each( fonts[ id ].variants, function( key, value ) {
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).append( jQuery( '<option></option>' ).attr( 'value', value ).text( value ) );
|
||||
} );
|
||||
|
||||
// Set our variants
|
||||
if ( ! got_variants ) {
|
||||
control.settings[ 'variant' ].set( fonts[ id ].variants );
|
||||
} else {
|
||||
control.settings[ 'variant' ].set( updated_variants );
|
||||
}
|
||||
|
||||
// Set our font category
|
||||
control.settings[ 'category' ].set( fonts[ id ].category );
|
||||
jQuery( 'input[name="' + _categoryID + '"' ).val( fonts[ id ].category );
|
||||
} else {
|
||||
_this.closest( '.generatepress-font-family' ).next( 'div' ).hide();
|
||||
control.settings[ 'category' ].set( '' )
|
||||
control.settings[ 'variant' ].set( '' )
|
||||
jQuery( 'input[name="' + _categoryID + '"' ).val( '' );
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove();
|
||||
}
|
||||
}, 25 );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-variant select',
|
||||
function() {
|
||||
var _this = jQuery( this );
|
||||
var variants = _this.val();
|
||||
|
||||
control.settings['variant'].set( variants );
|
||||
|
||||
jQuery( '.generatepress-font-variant select' ).each( function( key, value ) {
|
||||
var this_control = jQuery( this ).closest( 'li' ).attr( 'id' ).replace( 'customize-control-', '' );
|
||||
var parent = jQuery( this ).closest( '.generatepress-font-variant' );
|
||||
var font_val = api.control( this_control ).settings['family'].get();
|
||||
|
||||
if ( font_val == control.settings['family'].get() && _this.attr( 'name' ) !== jQuery( value ).attr( 'name' ) ) {
|
||||
jQuery( parent.find( 'select' ) ).not( _this ).val( variants ).triggerHandler( 'change' );
|
||||
api.control( this_control ).settings['variant'].set( variants );
|
||||
}
|
||||
} );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-category input',
|
||||
function() {
|
||||
control.settings['category'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-weight select',
|
||||
function() {
|
||||
control.settings['weight'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-transform select',
|
||||
function() {
|
||||
control.settings['transform'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
} );
|
||||
|
||||
} )( wp.customize );
|
||||
|
||||
jQuery( document ).ready( function( $ ) {
|
||||
|
||||
$( '.generatepress-font-family select' ).select2();
|
||||
|
||||
$( '.generatepress-font-variant' ).each( function( key, value ) {
|
||||
var _this = $( this );
|
||||
var value = _this.data( 'saved-value' );
|
||||
|
||||
if ( value ) {
|
||||
value = value.toString().split( ',' );
|
||||
}
|
||||
|
||||
_this.find( 'select' ).select2().val( value ).trigger( 'change.select2' );
|
||||
} );
|
||||
|
||||
$( ".generatepress-font-family" ).each( function( key, value ) {
|
||||
var _this = $( this );
|
||||
if ( $.inArray( _this.find( 'select' ).val(), typography_defaults ) !== -1 ) {
|
||||
_this.next( '.generatepress-font-variant' ).hide();
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
||||
|
@ -17,7 +17,6 @@ GeneratePress_Customize_Field::add_title(
|
||||
'choices' => array(
|
||||
'toggleId' => 'top-bar-colors',
|
||||
),
|
||||
'active_callback' => 'generate_is_top_bar_active',
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -351,6 +351,7 @@ function generate_do_control_inline_scripts() {
|
||||
'generateCustomizerControls',
|
||||
array(
|
||||
'palette' => $colors,
|
||||
'showGoogleFonts' => apply_filters( 'generate_font_manager_show_google_fonts', true ),
|
||||
)
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user