Skip to content

Commit

Permalink
Use es6
Browse files Browse the repository at this point in the history
  • Loading branch information
daviferreira committed Jun 18, 2017
1 parent 90ec068 commit 22d369b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/AccordionItem/index.jsx
Expand Up @@ -64,8 +64,8 @@ export default class AccordionItem extends Component {
}

setMaxHeight() {
var bodyNode = ReactDOM.findDOMNode(this.refs.body);
var images = bodyNode.querySelectorAll('img');
const bodyNode = ReactDOM.findDOMNode(this.refs.body);
const images = bodyNode.querySelectorAll('img');

if (images.length > 0) {
return this.preloadImages(bodyNode, images);
Expand All @@ -79,8 +79,8 @@ export default class AccordionItem extends Component {

// Wait for images to load before calculating maxHeight
preloadImages(node, images = []) {
var imagesLoaded = 0;
var imgLoaded = () => {
let imagesLoaded = 0;
const imgLoaded = () => {
imagesLoaded++;

if (imagesLoaded === images.length) {
Expand All @@ -99,7 +99,7 @@ export default class AccordionItem extends Component {
}

getProps() {
var props = {
const props = {
className: className(
'react-sanfona-item',
this.props.className,
Expand Down
2 changes: 1 addition & 1 deletion src/AccordionItemBody/index.jsx
Expand Up @@ -6,7 +6,7 @@ import PropTypes from 'prop-types';

export default class AccordionItemBody extends Component {
render() {
var style = {
const style = {
maxHeight: this.props.maxHeight,
overflow: this.props.overflow,
transition: `max-height ${this.props.duration}ms ease`,
Expand Down
2 changes: 1 addition & 1 deletion src/AccordionItemTitle/index.jsx
Expand Up @@ -6,7 +6,7 @@ import PropTypes from 'prop-types';

export default class AccordionItemTitle extends Component {
render() {
var style = {
const style = {
cursor: 'pointer',
margin: 0,
color: this.props.titleColor,
Expand Down

0 comments on commit 22d369b

Please sign in to comment.