Skip to content

Commit

Permalink
Reformat, see #451
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jan 17, 2019
1 parent 680cd98 commit d8a9db3
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 32 deletions.
4 changes: 2 additions & 2 deletions js/AccordionBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@ define( function( require ) {
// Limit width by the necessary space for the title node
if ( this._titleAlignX === 'center' ) {
// Handles case where the spacing on the left side of the title is larger than the spacing on the right side.
width = Math.max( width, (this._buttonXMargin + this.expandCollapseButton.width + this._titleXSpacing) * 2 + this.titleNode.width );
width = Math.max( width, ( this._buttonXMargin + this.expandCollapseButton.width + this._titleXSpacing ) * 2 + this.titleNode.width );

// Handles case where the spacing on the right side of the title is larger than the spacing on the left side.
width = Math.max( width, (this._titleXMargin) * 2 + this.titleNode.width );
width = Math.max( width, ( this._titleXMargin ) * 2 + this.titleNode.width );
}

// Compare width of title section to content section of the accordion box
Expand Down
3 changes: 2 additions & 1 deletion js/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ define( function( require ) {

// Computations related to layout of items
var numberOfSeparators = ( options.separatorsVisible ) ? ( items.length - 1 ) : 0;
var scrollingLength = ( items.length * ( maxItemLength + options.spacing ) + ( numberOfSeparators * options.spacing) + options.spacing );
var scrollingLength = ( items.length * ( maxItemLength + options.spacing ) + ( numberOfSeparators * options.spacing ) + options.spacing );
var scrollingWidth = isHorizontal ? scrollingLength : ( maxItemWidth + 2 * options.margin );
var scrollingHeight = isHorizontal ? ( maxItemHeight + 2 * options.margin ) : scrollingLength;
var itemCenter = options.spacing + ( maxItemLength / 2 );
Expand Down Expand Up @@ -252,6 +252,7 @@ define( function( require ) {

// Change pages
var scrollAnimation = null;

function pageNumberListener( pageNumber ) {

assert && assert( pageNumber >= 0 && pageNumber <= numberOfPages - 1, 'pageNumber out of range: ' + pageNumber );
Expand Down
20 changes: 10 additions & 10 deletions js/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ define( require => {
// @private the popup listbox
this.listBox = new ComboBoxListBox( property, items, this.button,
this.hideList.bind( this ), options.tandem.createTandem( 'listBox' ), {
align: options.align,
highlightFill: options.highlightFill,
xMargin: options.xMargin,
yMargin: options.yMargin,
cornerRadius: options.cornerRadius,
fill: options.listFill,
stroke: options.listStroke,
lineWidth: options.listLineWidth,
visible: false
} );
align: options.align,
highlightFill: options.highlightFill,
xMargin: options.xMargin,
yMargin: options.yMargin,
cornerRadius: options.cornerRadius,
fill: options.listFill,
stroke: options.listStroke,
lineWidth: options.listLineWidth,
visible: false
} );
listParent.addChild( this.listBox );
this.listParent = listParent; // @private

Expand Down
2 changes: 1 addition & 1 deletion js/ComboBoxListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ define( require => {
this.disposeComboBoxListBox();
super.dispose();
}

/**
* Updates the focus to match the currently selected value.
* @public
Expand Down
2 changes: 1 addition & 1 deletion js/ComboBoxListItemNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ define( require => {
tagName: 'li',
ariaRole: 'option',
a11yLabel: null

}, options );

// Highlight rectangle
Expand Down
6 changes: 3 additions & 3 deletions js/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ define( function( require ) {
if ( options.isAccessible ) {
this.initializeAccessibleSlider( valueProperty, this.enabledRangeProperty, this.enabledProperty,
_.extend( {}, options, {
ariaOrientation: options.orientation
}
) );
ariaOrientation: options.orientation
}
) );
}

// support for binder documentation, stripped out in builds and only runs when ?binder is specified
Expand Down
2 changes: 1 addition & 1 deletion js/accessibility/AccessibleNumberSpinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ define( function( require ) {
// if a key is currently down when focus leaves the spinner, stop callbacks and emit that the
// keycode is up
if ( self._a11yUseTimer && downCallback ) {
assert && assert( runningTimerCallbackKeyCode !== null, 'key should be down if running downCallback');
assert && assert( runningTimerCallbackKeyCode !== null, 'key should be down if running downCallback' );

self.emitKeyState( runningTimerCallbackKeyCode, false );
self._callbackTimer.stop( false );
Expand Down
4 changes: 2 additions & 2 deletions js/accessibility/AccessibleSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ define( function( require ) {
self.removeInputListener( accessibleInputListener );
};
},

/**
* Get the mapped value to be read by AT.
*
Expand Down Expand Up @@ -502,7 +502,7 @@ define( function( require ) {
* a change event is sent but an input event ins't handled. Guarded against the case that BOTH change and
* input are sent to the browser by the AT.
* @private
*
*
* @param {Event} event
*/
handleChange: function( event ) {
Expand Down
12 changes: 6 additions & 6 deletions js/buttons/RectangularButtonView.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ define( function( require ) {
// convenience function for creating the shape of the button, done to avoid code duplication
function createButtonShape( width, height, options ) {
return Shape.roundedRectangleWithRadii( 0, 0, width, height, {
topLeft: typeof( options.leftTopCornerRadius ) === 'number' ? options.leftTopCornerRadius : options.cornerRadius,
topRight: typeof( options.rightTopCornerRadius ) === 'number' ? options.rightTopCornerRadius : options.cornerRadius,
bottomLeft: typeof( options.leftBottomCornerRadius ) === 'number' ? options.leftBottomCornerRadius : options.cornerRadius,
bottomRight: typeof( options.rightBottomCornerRadius ) === 'number' ? options.rightBottomCornerRadius : options.cornerRadius
topLeft: typeof ( options.leftTopCornerRadius ) === 'number' ? options.leftTopCornerRadius : options.cornerRadius,
topRight: typeof ( options.rightTopCornerRadius ) === 'number' ? options.rightTopCornerRadius : options.cornerRadius,
bottomLeft: typeof ( options.leftBottomCornerRadius ) === 'number' ? options.leftBottomCornerRadius : options.cornerRadius,
bottomRight: typeof ( options.rightBottomCornerRadius ) === 'number' ? options.rightBottomCornerRadius : options.cornerRadius
} );
}

Expand Down Expand Up @@ -300,7 +300,7 @@ define( function( require ) {
enabledStroke = null;
disabledStroke = null;
}
else if ( typeof( options.stroke ) === 'undefined' ) {
else if ( typeof ( options.stroke ) === 'undefined' ) {
// No stroke was defined, but it wasn't set to null, so default to a stroke based on the base color of the
// button. This behavior is a bit unconventional for Scenery nodes, but it makes the buttons look much better.
enabledStroke = baseDarker4;
Expand Down Expand Up @@ -429,7 +429,7 @@ define( function( require ) {
enabledStroke = null;
disabledStroke = null;
}
else if ( typeof( options.stroke ) === 'undefined' ) {
else if ( typeof ( options.stroke ) === 'undefined' ) {
// No stroke was defined, but it wasn't set to null, so default to a stroke based on the base color of the
// button. This behavior is a bit unconventional for Scenery nodes, but it makes the buttons look much better.
enabledStroke = baseDarker4;
Expand Down
4 changes: 2 additions & 2 deletions js/buttons/RoundButtonView.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ define( function( require ) {
enabledStroke = null;
disabledStroke = null;
}
else if ( typeof( options.stroke ) === 'undefined' ) {
else if ( typeof ( options.stroke ) === 'undefined' ) {
// No stroke was defined, but it wasn't set to null, so default to a stroke based on the base color of the
// button. This behavior is a bit unconventional for Scenery nodes, but it makes the buttons look much better.
enabledStroke = baseDarker4;
Expand Down Expand Up @@ -366,7 +366,7 @@ define( function( require ) {
enabledStroke = null;
disabledStroke = null;
}
else if ( typeof( options.stroke ) === 'undefined' ) {
else if ( typeof ( options.stroke ) === 'undefined' ) {
// No stroke was defined, but it wasn't set to null, so default to a stroke based on the base color of the
// button. This behavior is a bit unconventional for Scenery nodes, but it makes the buttons look much better.
enabledStroke = baseDarker4;
Expand Down
4 changes: 2 additions & 2 deletions js/buttons/StickyToggleButtonInteractionStateProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ define( function( require ) {
var isValueDown = propertyValue === buttonModel.valueDown;
return !enabled && isValueDown ? ButtonInteractionState.DISABLED_PRESSED :
!enabled ? ButtonInteractionState.DISABLED :
over && !(looksPressed || isValueDown) ? ButtonInteractionState.OVER :
over && (looksPressed || isValueDown) ? ButtonInteractionState.PRESSED :
over && !( looksPressed || isValueDown ) ? ButtonInteractionState.OVER :
over && ( looksPressed || isValueDown ) ? ButtonInteractionState.PRESSED :
isValueDown ? ButtonInteractionState.PRESSED :
ButtonInteractionState.IDLE;
} );
Expand Down
2 changes: 1 addition & 1 deletion js/buttons/ToggleButtonInteractionStateProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ define( function( require ) {
[ buttonModel.overProperty, buttonModel.looksPressedProperty, buttonModel.enabledProperty ],
function( over, looksPressed, enabled ) {
return !enabled ? ButtonInteractionState.DISABLED :
over && !(looksPressed ) ? ButtonInteractionState.OVER :
over && !( looksPressed ) ? ButtonInteractionState.OVER :
looksPressed ? ButtonInteractionState.PRESSED :
ButtonInteractionState.IDLE;
}
Expand Down

0 comments on commit d8a9db3

Please sign in to comment.