fix navigator lint warnings

Summary: fix some lint warnings under `Libraries/CustomComponents/Navigator/` directory
Closes https://github.com/facebook/react-native/pull/4447

Reviewed By: svcscm

Differential Revision: D2706390

Pulled By: ericvicenti

fb-gh-sync-id: 5bfed687265e07a162ffc528a41fa5b0d384f635
This commit is contained in:
Huang Yu 2015-11-30 19:30:17 -08:00 committed by facebook-github-bot-2
parent baa97b2e9f
commit 7242efde0a
5 changed files with 10 additions and 11 deletions

View File

@ -675,7 +675,7 @@ var Navigator = React.createClass({
this.state.presentedIndex = destIndex; this.state.presentedIndex = destIndex;
this._transitionTo( this._transitionTo(
transitionBackToPresentedIndex, transitionBackToPresentedIndex,
- transitionVelocity, -transitionVelocity,
1 - this.spring.getCurrentValue() 1 - this.spring.getCurrentValue()
); );
} }
@ -750,7 +750,7 @@ var Navigator = React.createClass({
var isTravelVertical = gesture.direction === 'top-to-bottom' || gesture.direction === 'bottom-to-top'; var isTravelVertical = gesture.direction === 'top-to-bottom' || gesture.direction === 'bottom-to-top';
var isTravelInverted = gesture.direction === 'right-to-left' || gesture.direction === 'bottom-to-top'; var isTravelInverted = gesture.direction === 'right-to-left' || gesture.direction === 'bottom-to-top';
var distance = isTravelVertical ? gestureState.dy : gestureState.dx; var distance = isTravelVertical ? gestureState.dy : gestureState.dx;
distance = isTravelInverted ? - distance : distance; distance = isTravelInverted ? -distance : distance;
var gestureDetectMovement = gesture.gestureDetectMovement; var gestureDetectMovement = gesture.gestureDetectMovement;
var nextProgress = (distance - gestureDetectMovement) / var nextProgress = (distance - gestureDetectMovement) /
(gesture.fullDistance - gestureDetectMovement); (gesture.fullDistance - gestureDetectMovement);

View File

@ -46,11 +46,11 @@ var PropTypes = React.PropTypes;
/** /**
* Reusable props objects. * Reusable props objects.
*/ */
var CRUMB_PROPS = Interpolators.map(() => {return {style: {}};}); var CRUMB_PROPS = Interpolators.map(() => ({style: {}}));
var ICON_PROPS = Interpolators.map(() => {return {style: {}};}); var ICON_PROPS = Interpolators.map(() => ({style: {}}));
var SEPARATOR_PROPS = Interpolators.map(() => {return {style: {}};}); var SEPARATOR_PROPS = Interpolators.map(() => ({style: {}}));
var TITLE_PROPS = Interpolators.map(() => {return {style: {}};}); var TITLE_PROPS = Interpolators.map(() => ({style: {}}));
var RIGHT_BUTTON_PROPS = Interpolators.map(() => {return {style: {}};}); var RIGHT_BUTTON_PROPS = Interpolators.map(() => ({style: {}}));
var navStatePresentedIndex = function(navState) { var navStatePresentedIndex = function(navState) {

View File

@ -136,7 +136,7 @@ CENTER[0] = {
Title: merge(FIRST_TITLE_BASE, {opacity: 1}), Title: merge(FIRST_TITLE_BASE, {opacity: 1}),
RightItem: CENTER[0].RightItem, RightItem: CENTER[0].RightItem,
}; };
LEFT[0].Title = merge(FIRST_TITLE_BASE, {left: - SCREEN_WIDTH / 4, opacity: 0}); LEFT[0].Title = merge(FIRST_TITLE_BASE, {left: -SCREEN_WIDTH / 4, opacity: 0});
RIGHT[0].Title = merge(FIRST_TITLE_BASE, {opacity: 0}); RIGHT[0].Title = merge(FIRST_TITLE_BASE, {opacity: 0});

View File

@ -30,7 +30,6 @@ var React = require('React');
var NavigatorNavigationBarStylesAndroid = require('NavigatorNavigationBarStylesAndroid'); var NavigatorNavigationBarStylesAndroid = require('NavigatorNavigationBarStylesAndroid');
var NavigatorNavigationBarStylesIOS = require('NavigatorNavigationBarStylesIOS'); var NavigatorNavigationBarStylesIOS = require('NavigatorNavigationBarStylesIOS');
var Platform = require('Platform'); var Platform = require('Platform');
var StaticContainer = require('StaticContainer.react');
var StyleSheet = require('StyleSheet'); var StyleSheet = require('StyleSheet');
var View = require('View'); var View = require('View');

View File

@ -76,8 +76,8 @@ var BASE_STYLES = {
// center-to-left transition on the current navigation item. // center-to-left transition on the current navigation item.
var Stages = { var Stages = {
Left: { Left: {
Title: merge(BASE_STYLES.Title, { left: - SCREEN_WIDTH / 2, opacity: 0 }), Title: merge(BASE_STYLES.Title, { left: -SCREEN_WIDTH / 2, opacity: 0 }),
LeftButton: merge(BASE_STYLES.LeftButton, { left: - SCREEN_WIDTH / 3, opacity: 0 }), LeftButton: merge(BASE_STYLES.LeftButton, { left: -SCREEN_WIDTH / 3, opacity: 0 }),
RightButton: merge(BASE_STYLES.RightButton, { left: SCREEN_WIDTH / 3, opacity: 0 }), RightButton: merge(BASE_STYLES.RightButton, { left: SCREEN_WIDTH / 3, opacity: 0 }),
}, },
Center: { Center: {