Skip to content

Commit

Permalink
format prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
sarmeyer committed Jan 13, 2019
1 parent 162b20e commit 80a06ad
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 74 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js

node_js:
- "6"
- "8"
- '6'
- '8'

sudo: false

Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"files.autoSave": "onFocusChange"
}
"files.autoSave": "onFocusChange"
}
20 changes: 11 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,31 @@
## 4.4.4 (2018-12-07)

- [#460](https://github.com/FormidableLabs/nuka-carousel/pull/460) Ability to configure aria-live message with prop
- [#458](https://github.com/FormidableLabs/nuka-carousel/pull/458) Fix flicker in wrap-around
- [#458](https://github.com/FormidableLabs/nuka-carousel/pull/458) Fix flicker in wrap-around
- [#453](https://github.com/FormidableLabs/nuka-carousel/pull/453) Fix issue involving updating props on beforeSlide

## 4.4.3 (2018-11-16)

- [#451](https://github.com/FormidableLabs/nuka-carousel/pull/451) Allow clicks with modifier present
- [#446](https://github.com/FormidableLabs/nuka-carousel/pull/446) Fix for demo (toggle between 2 and 6 slides showing)
- [#445](https://github.com/FormidableLabs/nuka-carousel/pull/445) Add `disableKeyboardControls` prop to allow users to disable keyboard controls
- [#441](https://github.com/FormidableLabs/nuka-carousel/pull/441) Start work on removing deprecated lifecycle methods
- [#439](https://github.com/FormidableLabs/nuka-carousel/pull/439) Allow `pauseOnHover` to work when swiping/dragging is disabled
- [#436](https://github.com/FormidableLabs/nuka-carousel/pull/436) Refactoring
- [#451](https://github.com/FormidableLabs/nuka-carousel/pull/451) Allow clicks with modifier present
- [#446](https://github.com/FormidableLabs/nuka-carousel/pull/446) Fix for demo (toggle between 2 and 6 slides showing)
- [#445](https://github.com/FormidableLabs/nuka-carousel/pull/445) Add `disableKeyboardControls` prop to allow users to disable keyboard controls
- [#441](https://github.com/FormidableLabs/nuka-carousel/pull/441) Start work on removing deprecated lifecycle methods
- [#439](https://github.com/FormidableLabs/nuka-carousel/pull/439) Allow `pauseOnHover` to work when swiping/dragging is disabled
- [#436](https://github.com/FormidableLabs/nuka-carousel/pull/436) Refactoring

## 4.4.2 (2018-10-29)

- [#425](https://github.com/FormidableLabs/nuka-carousel/pull/425) Accessibility features added
- [#425](https://github.com/FormidableLabs/nuka-carousel/pull/425) Accessibility features added

1. Adding keyboard controls
2. Reader lets you know what slide you are on
3. Slide that is being display will be read by reader

- [#435](https://github.com/FormidableLabs/nuka-carousel/pull/435) Fix issues where `clickDisabled` is set to true too often
- [#433](https://github.com/FormidableLabs/nuka-carousel/pull/433) add function to add ariaProps to all visible slides
- [#432](https://github.com/FormidableLabs/nuka-carousel/pull/432) Add `slide-visible` class to all currently visible slides
- [#431](https://github.com/FormidableLabs/nuka-carousel/pull/431) Carousel would go into an infinite loop between two slide. Added a isTransitioning check to wait until afterSlide is finish.

## 4.4.1 (2018-10-08)

- [#423](https://github.com/FormidableLabs/nuka-carousel/pull/423) Prevent click events only when swiping
- [#423](https://github.com/FormidableLabs/nuka-carousel/pull/423) Prevent click events only when swiping
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Contributing
============
# Contributing

## Install

Expand Down
66 changes: 33 additions & 33 deletions README.md

Large diffs are not rendered by default.

43 changes: 26 additions & 17 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
</head>
<body>
<!--[if lt IE 8]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div id="content">
<h1>If you can see this, something is broken (or JS is not enabled)!!.</h1>
</div>
<script type="text/javascript" src="/assets/main.js"></script>
</body>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title></title>
<meta name="description" content="" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
</head>
<body>
<!--[if lt IE 8]>
<p class="browsehappy">
You are using an <strong>outdated</strong> browser. Please
<a href="http://browsehappy.com/">upgrade your browser</a> to improve
your experience.
</p>
<![endif]-->
<div id="content">
<h1>
If you can see this, something is broken (or JS is not enabled)!!.
</h1>
</div>
<script type="text/javascript" src="/assets/main.js"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -744,13 +744,13 @@ export default class Carousel extends React.Component {
let slideWidth;

if (this.props.animation === 'zoom') {
slideWidth = frame.offsetWidth - frame.offsetWidth * 15 / 100;
slideWidth = frame.offsetWidth - (frame.offsetWidth * 15) / 100;
} else if (typeof props.slideWidth !== 'number') {
slideWidth = parseInt(props.slideWidth);
} else if (props.vertical) {
slideWidth = slideHeight / slidesToShow * props.slideWidth;
slideWidth = (slideHeight / slidesToShow) * props.slideWidth;
} else {
slideWidth = frame.offsetWidth / slidesToShow * props.slideWidth;
slideWidth = (frame.offsetWidth / slidesToShow) * props.slideWidth;
}

if (!props.vertical) {
Expand Down
4 changes: 2 additions & 2 deletions src/transitions/fade-transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ export default class FadeTransition extends React.Component {
display: 'block',
height: this.props.slideHeight,
margin: this.props.vertical
? `${this.props.cellSpacing / 2 * -1}px 0px`
: `0px ${this.props.cellSpacing / 2 * -1}px`,
? `${(this.props.cellSpacing / 2) * -1}px 0px`
: `0px ${(this.props.cellSpacing / 2) * -1}px`,
MozBoxSizing: 'border-box',
padding: 0,
touchAction: 'none',
Expand Down
4 changes: 2 additions & 2 deletions src/transitions/scroll-transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ export default class ScrollTransition extends React.Component {
position: 'relative',
display: 'block',
margin: this.props.vertical
? `${this.props.cellSpacing / 2 * -1}px 0px`
: `0px ${this.props.cellSpacing / 2 * -1}px`,
? `${(this.props.cellSpacing / 2) * -1}px 0px`
: `0px ${(this.props.cellSpacing / 2) * -1}px`,
padding: 0,
height: this.props.vertical
? listWidth + spacingOffset
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const swipeDirection = (x1, x2, y1, y2, vertical) => {
const xDist = x1 - x2;
const yDist = y1 - y2;
const r = Math.atan2(yDist, xDist);
let swipeAngle = Math.round(r * 180 / Math.PI);
let swipeAngle = Math.round((r * 180) / Math.PI);

if (swipeAngle < 0) {
swipeAngle = 360 - Math.abs(swipeAngle);
Expand Down
4 changes: 3 additions & 1 deletion test/specs/carousel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ describe('<Carousel />', () => {
const wrapper = mount(
<Carousel>
<p key="Static Slide">Static Slide</p>
{elems.map(e => <p key={e}>{e}</p>)}
{elems.map(e => (
<p key={e}>{e}</p>
))}
</Carousel>
);
expect(wrapper).toHaveState({ slideCount: 4 });
Expand Down

0 comments on commit 80a06ad

Please sign in to comment.