Skip to content

Commit

Permalink
fixes #1689 & grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Dec 6, 2017
1 parent 43dc8bd commit c7fc44e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions controls/js/dist/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3539,7 +3539,7 @@ wp.customize.controlConstructor['kirki-typography'] = wp.customize.kirkiDynamicC

} else {
_.each( control.params.choices.fonts.google, function( fontName ) {
if ( 'undefined' !== typeof initialGoogleFonts[ fontName ] ) {
if ( 'undefined' !== typeof initialGoogleFonts[ fontName ] && ! _.isEmpty( initialGoogleFonts[ fontName ] ) ) {
googleFonts[ fontName ] = initialGoogleFonts[ fontName ];
}
} );
Expand All @@ -3549,19 +3549,19 @@ wp.customize.controlConstructor['kirki-typography'] = wp.customize.kirkiDynamicC
}

// Get standard fonts.
if ( 'undefined' !== typeof control.params.choices && 'undefined' !== typeof control.params.choices && 'undefined' !== typeof control.params.choices.fonts && 'undefined' !== typeof control.params.choices.fonts.standard ) {
if ( ! _.isEmpty( control.params.choices.fonts.standard ) ) {
_.each( control.params.choices.fonts.standard, function( fontName ) {
if ( 'undefined' !== typeof kirki.util.webfonts.standard.fonts[ fontName ] ) {
if ( 'undefined' !== typeof kirki.util.webfonts.standard.fonts[ fontName ] && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ] ) ) {
standardFonts[ fontName ] = {};
if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].stack ) {
if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].stack && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ].stack ) ) {
standardFonts[ fontName ].family = kirki.util.webfonts.standard.fonts[ fontName ].stack;
} else {
standardFonts[ fontName ].family = googleFonts[ fontName ];
}
if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].label ) {
if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].label && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ].label ) ) {
standardFonts[ fontName ].label = kirki.util.webfonts.standard.fonts[ fontName ].label;
} else {
standardFonts[ fontName ].label = googleFonts[ fontName ];
} else if ( ! _.isEmpty( standardFonts[ fontName ] ) ) {
standardFonts[ fontName ].label = standardFonts[ fontName ];
}
} else {
standardFonts[ fontName ] = {
Expand Down
2 changes: 1 addition & 1 deletion controls/js/dist/script.min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions controls/js/src/typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ wp.customize.controlConstructor['kirki-typography'] = wp.customize.kirkiDynamicC

} else {
_.each( control.params.choices.fonts.google, function( fontName ) {
if ( 'undefined' !== typeof initialGoogleFonts[ fontName ] ) {
if ( 'undefined' !== typeof initialGoogleFonts[ fontName ] && ! _.isEmpty( initialGoogleFonts[ fontName ] ) ) {
googleFonts[ fontName ] = initialGoogleFonts[ fontName ];
}
} );
Expand All @@ -355,19 +355,19 @@ wp.customize.controlConstructor['kirki-typography'] = wp.customize.kirkiDynamicC
}

// Get standard fonts.
if ( 'undefined' !== typeof control.params.choices && 'undefined' !== typeof control.params.choices && 'undefined' !== typeof control.params.choices.fonts && 'undefined' !== typeof control.params.choices.fonts.standard ) {
if ( ! _.isEmpty( control.params.choices.fonts.standard ) ) {
_.each( control.params.choices.fonts.standard, function( fontName ) {
if ( 'undefined' !== typeof kirki.util.webfonts.standard.fonts[ fontName ] ) {
if ( 'undefined' !== typeof kirki.util.webfonts.standard.fonts[ fontName ] && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ] ) ) {
standardFonts[ fontName ] = {};
if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].stack ) {
if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].stack && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ].stack ) ) {
standardFonts[ fontName ].family = kirki.util.webfonts.standard.fonts[ fontName ].stack;
} else {
standardFonts[ fontName ].family = googleFonts[ fontName ];
}
if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].label ) {
if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].label && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ].label ) ) {
standardFonts[ fontName ].label = kirki.util.webfonts.standard.fonts[ fontName ].label;
} else {
standardFonts[ fontName ].label = googleFonts[ fontName ];
} else if ( ! _.isEmpty( standardFonts[ fontName ] ) ) {
standardFonts[ fontName ].label = standardFonts[ fontName ];
}
} else {
standardFonts[ fontName ] = {
Expand Down
2 changes: 1 addition & 1 deletion modules/webfonts/webfonts.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/webfonts/webfonts.php

Large diffs are not rendered by default.

0 comments on commit c7fc44e

Please sign in to comment.