Change const variable name

This commit is contained in:
John Furrow
2016-01-09 09:52:20 -08:00
parent 55c8dbaaad
commit a1945175b5
14 changed files with 30 additions and 31 deletions

View File

@@ -8,7 +8,7 @@ import TorrentFilterStore from '../../stores/TorrentFilterStore';
import TorrentStore from '../../stores/TorrentStore';
import UIActions from '../../actions/UIActions';
const methodsToBind = [
const METHODS_TO_BIND = [
'handleAddTorrents',
'handleSortChange',
'handleStart',
@@ -24,7 +24,7 @@ export default class ActionBar extends React.Component {
sortBy: TorrentFilterStore.getTorrentsSort()
};
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -5,7 +5,7 @@ import React from 'react';
import Dropdown from '../generic/Dropdown';
import UIActions from '../../actions/UIActions';
const methodsToBind = [
const METHODS_TO_BIND = [
'getDropdownHeader',
'handleItemSelect'
];
@@ -14,7 +14,7 @@ export default class SortDropdown extends React.Component {
constructor() {
super();
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -3,7 +3,7 @@ import React from 'react';
import Icon from '../icons/Icon.js';
const methodsToBind = [
const METHODS_TO_BIND = [
'getTextboxes',
'handleTextboxChange'
];
@@ -13,7 +13,7 @@ export default class TextboxRepeater extends React.Component {
constructor() {
super();
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -3,7 +3,7 @@ import classnames from 'classnames';
import CSSTransitionGroup from 'react-addons-css-transition-group';
import React from 'react';
const methodsToBind = [
const METHODS_TO_BIND = [
'getDropdownButton',
'getDropdownMenu',
'getDropdownMenuItems',
@@ -21,7 +21,7 @@ export default class Dropdown extends React.Component {
isExpanded: false
};
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}
@@ -82,10 +82,9 @@ export default class Dropdown extends React.Component {
getDropdownMenuItems(listItems) {
return listItems.map(function(property, index) {
let classes = classnames({
'dropdown__item': true,
'is-selected': this.props.selectedItem.property === property.property &&
this.props.selectedItem.value === property.value
let classes = classnames('dropdown__item', property.className, {
'is-selectable': property.selectable !== false,
'is-selected': property.selected
})
return (
<li className={classes} key={index} onClick={this.handleItemSelect.bind(this, property)}>

View File

@@ -5,7 +5,7 @@ import React from 'react';
import TextboxRepeater from '../forms/TextboxRepeater';
import TorrentActions from '../../actions/TorrentActions';
const methodsToBind = [
const METHODS_TO_BIND = [
'getContent',
'handleDestinationChange',
'handleUrlAdd',
@@ -24,7 +24,7 @@ export default class AddTorrents extends React.Component {
urlTextboxes: [{value: null}]
};
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -7,7 +7,7 @@ import Icon from '../icons/Icon';
import UIActions from '../../actions/UIActions';
import UIStore from '../../stores/UIStore';
const methodsToBind = [
const METHODS_TO_BIND = [
'handleOverlayClick',
'onModalChange'
];
@@ -20,7 +20,7 @@ export default class Modal extends React.Component {
activeModal: null
};
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -7,7 +7,7 @@ import format from '../../util/formatData';
import Icon from '../icons/Icon';
import LineChart from './LineChart';
const methodsToBind = [
const METHODS_TO_BIND = [
'onTransferDataRequestError',
'onTransferDataRequestSuccess'
];
@@ -22,7 +22,7 @@ class ClientStats extends React.Component {
transferDataRequestSuccess: false
};
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -4,7 +4,7 @@ import React from'react';
import Icon from '../icons/Icon';
import UIActions from '../../actions/UIActions';
const methodsToBind = [
const METHODS_TO_BIND = [
'handleKeyUp'
];
@@ -16,7 +16,7 @@ export default class SearchBox extends React.Component {
searchValue: ''
};
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -3,7 +3,7 @@ import React from 'react';
import Icon from '../icons/Icon.js';
const methodsToBind = [
const METHODS_TO_BIND = [
'handleClick'
];
@@ -12,7 +12,7 @@ export default class StatusFilter extends React.Component {
constructor() {
super();
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -7,7 +7,7 @@ import StatusFilter from './StatusFilter';
import TorrentFilterStore from '../../stores/TorrentFilterStore';
import UIActions from '../../actions/UIActions';
const methodsToBind = [
const METHODS_TO_BIND = [
'getFilters',
'handleClick',
'onStatusFilterChange'
@@ -21,7 +21,7 @@ export default class StatusFilters extends React.Component {
statusFilter: TorrentFilterStore.getStatusFilter()
};
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -5,7 +5,7 @@ import format from '../../util/formatData';
import Icon from '../icons/Icon';
import ProgressBar from './ProgressBar';
const methodsToBind = [
const METHODS_TO_BIND = [
'handleClick',
'handleRightClick'
];
@@ -15,7 +15,7 @@ export default class Torrent extends React.Component {
constructor() {
super();
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -10,7 +10,7 @@ import TorrentActions from '../../actions/TorrentActions';
import TorrentStore from '../../stores/TorrentStore';
import UIStore from '../../stores/UIStore';
const methodsToBind = [
const METHODS_TO_BIND = [
'getFileData',
'getFileTreeDomNodes',
'onTorrentDetailsHashChange',
@@ -34,7 +34,7 @@ export default class TorrentDetails extends React.Component {
torrentDetails: {}
};
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});
}

View File

@@ -11,7 +11,7 @@ import TorrentFilterStore from '../../stores/TorrentFilterStore';
import TorrentStore from '../../stores/TorrentStore';
import UIActions from '../../actions/UIActions';
const methodsToBind = [
const METHODS_TO_BIND = [
'onReceiveTorrentsError',
'onReceiveTorrentsSuccess',
'handleDetailsClick',
@@ -41,7 +41,7 @@ export default class TorrentListContainer extends React.Component {
viewportHeight: 0
};
methodsToBind.forEach((method) => {
METHODS_TO_BIND.forEach((method) => {
this[method] = this[method].bind(this);
});

View File

@@ -5,7 +5,7 @@ import React from 'react';
import TorrentDetails from './TorrentDetails';
import TorrentList from './TorrentList';
const methodsToBind = [
const METHODS_TO_BIND = [
'toggleDetailsPanel'
];