Skip to content

Commit

Permalink
Merge pull request JedWatson#2262 from JedWatson/2234-refactor
Browse files Browse the repository at this point in the history
2234 refactor
  • Loading branch information
gwyneplaine authored Jan 5, 2018
2 parents 99acc31 + 075336e commit 4a5d46f
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 128 deletions.
14 changes: 1 addition & 13 deletions src/Option.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';

const blockEvent = event => {
event.preventDefault();
event.stopPropagation();
if ((event.target.tagName !== 'A') || !('href' in event.target)) {
return;
}
if (event.target.target) {
window.open(event.target.href, event.target.target);
} else {
window.location.href = event.target.href;
}
};
import { blockEvent } from './utils/blockEvent';

class Option extends React.Component {

Expand Down
Loading

0 comments on commit 4a5d46f

Please sign in to comment.