Skip to content

Commit

Permalink
Fix more eslint.
Browse files Browse the repository at this point in the history
  • Loading branch information
miina committed May 24, 2018
1 parent d76a23e commit 5a45e80
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions assets/js/amp-editor-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
'core/quote',
'core/subhead'
],
ampSettingsLabel: __( 'AMP Settings' )
ampSettingsLabel: __( 'AMP Settings' ),
fontSizes: {
small: 14,
larger: 48
}
}
};

Expand Down Expand Up @@ -197,11 +201,11 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
};
settings.attributes.minFont = {
type: 'number',
default: 14
default: component.data.fontSizes.small
};
settings.attributes.maxFont = {
type: 'number',
default: 48
default: component.data.fontSizes.larger
};
settings.attributes.height = {
type: 'number',
Expand Down Expand Up @@ -424,7 +428,7 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
fontSizes: FONT_SIZES,
onChange: function( nextMinFont ) {
if ( ! nextMinFont ) {
nextMinFont = 14; // @todo Supplying fallbackFontSize should be done automatically by the component?
nextMinFont = component.data.fontSizes.small; // @todo Supplying fallbackFontSize should be done automatically by the component?
}
if ( nextMinFont <= maxFont ) {
props.setAttributes( { minFont: nextMinFont } );
Expand All @@ -447,7 +451,7 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
fontSizes: FONT_SIZES,
onChange: function( nextMaxFont ) {
if ( ! nextMaxFont ) {
nextMaxFont = 48; // @todo Supplying fallbackFontSize should be done automatically by the component?
nextMaxFont = component.data.fontSizes.larger; // @todo Supplying fallbackFontSize should be done automatically by the component?
}
props.setAttributes( {
maxFont: nextMaxFont,
Expand Down

0 comments on commit 5a45e80

Please sign in to comment.