Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ritz078 committed Apr 24, 2016
1 parent 7e29d64 commit 1d21153
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions dist/client/handleShortCuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function isModifierPressed(e) {
}

function handleShortCuts(e, syncedStore) {
console.log(e);
if (isModifierPressed(e) && e.keyCode === 80) {
e.preventDefault();
var newData = (0, _extends3.default)({}, syncedStore.getData());
Expand Down
13 changes: 8 additions & 5 deletions dist/client/ui/FuzzySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ var FuzzySearch = function (_Component) {
}
}, {
key: 'handleChange',
value: function handleChange() {
value: function handleChange(e) {
this.setState({
results: this.fuse.search(this.refs.searchBox.value)
results: this.fuse.search(e.target.value)
});
}
}, {
Expand All @@ -194,11 +194,12 @@ var FuzzySearch = function (_Component) {
var className = _props.className;
var width = _props.width;
var placeholder = _props.placeholder;
var show = _props.show;


var mainClass = (0, _classnames2.default)('react-fuzzy-search', className);

var showSearchBox = syncedStore.getData().showSearchBox;
var showSearchBox = show || syncedStore.getData().showSearchBox;

return _react2.default.createElement(
'span',
Expand Down Expand Up @@ -240,11 +241,13 @@ FuzzySearch.propTypes = {
width: _react.PropTypes.number,
list: _react.PropTypes.array.isRequired,
options: _react.PropTypes.object.isRequired,
placeholder: _react.PropTypes.string
placeholder: _react.PropTypes.string,
show: _react.PropTypes.bool
};

FuzzySearch.defaultProps = {
width: 430
width: 430,
show: false
};

exports.default = FuzzySearch;
6 changes: 3 additions & 3 deletions dist/client/ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _FuzzySearch = require('./FuzzySearch');
var _fuzzySearch = require('./fuzzySearch');

var _FuzzySearch2 = _interopRequireDefault(_FuzzySearch);
var _fuzzySearch2 = _interopRequireDefault(_fuzzySearch);

var _text_filter = require('./text_filter');

Expand Down Expand Up @@ -369,7 +369,7 @@ var StorybookControls = function (_React$Component) {
'✕'
)
),
_react2.default.createElement(_FuzzySearch2.default, {
_react2.default.createElement(_fuzzySearch2.default, {
list: this.formatStoryForSearch(),
options: options,
width: 430,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dev": "nodemon --watch src --exec 'npm run prepublish'"
},
"dependencies": {
"@kadira/react-split-pane": "^1.2.0",
"@kadira/react-split-pane": "^1.3.0",
"babel-core": "^6.3.15",
"babel-loader": "^6.2.0",
"babel-polyfill": "^6.3.15",
Expand Down

0 comments on commit 1d21153

Please sign in to comment.