Skip to content

Commit 2abd149

Browse files
author
Jonathan Berney
committed
fix IE11 compatibility issues
1 parent e5a6b3b commit 2abd149

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/pivotal-ui-react/iconography/iconography.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class Icon extends React.Component {
3535
const {src, verticalAlign, ...others} = this.props;
3636
const props = mergeProps(
3737
others,
38-
{className: classnames('icon', `icon-${verticalAlign}`, {'spinner': src.startsWith('spinner')})}
38+
{className: classnames('icon', `icon-${verticalAlign}`, {'spinner': src.indexOf('spinner') === 0})}
3939
);
4040

4141
return (<div {...props}>

src/pivotal-ui-react/table/table.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ const SORT_ORDER = {
3030
none: 2
3131
};
3232

33+
function find(arr, cb) {
34+
for (let i = 0; i < arr.length; i++) {
35+
if (cb(arr[i])) return arr[i];
36+
}
37+
}
38+
39+
3340
export class Table extends React.Component {
3441
static propTypes = {
3542
bodyRowClassName: PropTypes.string,
@@ -44,7 +51,7 @@ export class Table extends React.Component {
4451
super(props, context);
4552
const {columns, defaultSort} = props;
4653

47-
const sortColumn = columns.find(({sortable, attribute}) => {
54+
const sortColumn = find(columns, ({sortable, attribute}) => {
4855
return defaultSort ? attribute === defaultSort : sortable;
4956
});
5057
this.state = {sortColumn, sortOrder: SORT_ORDER.asc};
@@ -55,7 +62,7 @@ export class Table extends React.Component {
5562

5663
componentWillReceiveProps({columns, defaultSort}) {
5764
if (columns) {
58-
const sortColumn = columns.find(({sortable, attribute}) => {
65+
const sortColumn = find(columns, ({sortable, attribute}) => {
5966
return defaultSort ? attribute === defaultSort : sortable;
6067
});
6168
this.setState({sortColumn, sortOrder: SORT_ORDER.asc});
@@ -190,7 +197,7 @@ export class FlexTable extends Table {
190197
super(props, context);
191198
const {columns, defaultSort} = props;
192199

193-
const sortColumn = columns.find(({sortable, attribute}) => {
200+
const sortColumn = find(columns, ({sortable, attribute}) => {
194201
return defaultSort ? attribute === defaultSort : sortable;
195202
});
196203

0 commit comments

Comments
 (0)