Skip to content

Commit

Permalink
Revert "Don't enable if there is nothing in the editor"
Browse files Browse the repository at this point in the history
This reverts commit e4ca048.
  • Loading branch information
fsih committed Jan 26, 2018
1 parent e4ca048 commit c9165b0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
3 changes: 0 additions & 3 deletions src/components/mode-tools/mode-tools.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,11 @@ const ModeToolsComponent = props => {
</InputGroup>
<InputGroup className={classNames(styles.modLabeledIconHeight)}>
<LabeledIconButton
disabled={!props.hasItems}
imgSrc={flipHorizontalIcon}
title={props.intl.formatMessage(messages.flipHorizontal)}
onClick={props.onFlipHorizontal}
/>
<LabeledIconButton
disabled={!props.hasItems}
imgSrc={flipVerticalIcon}
title={props.intl.formatMessage(messages.flipVertical)}
onClick={props.onFlipVertical}
Expand All @@ -178,7 +176,6 @@ ModeToolsComponent.propTypes = {
className: PropTypes.string,
clipboardItems: PropTypes.arrayOf(PropTypes.array),
eraserValue: PropTypes.number,
hasItems: PropTypes.bool,
hasSelectedUncurvedPoints: PropTypes.bool,
hasSelectedUnpointedPoints: PropTypes.bool,
intl: intlShape.isRequired,
Expand Down
8 changes: 1 addition & 7 deletions src/containers/mode-tools.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import bindAll from 'lodash.bindall';
import ModeToolsComponent from '../components/mode-tools/mode-tools.jsx';
import {clearSelectedItems, setSelectedItems} from '../reducers/selected-items';
import {incrementPasteOffset, setClipboardItems} from '../reducers/clipboard';
import {clearSelection, getSelectedLeafItems, getSelectedRootItems} from '../helper/selection';
import {getAllRootItems, getAllSelectableRootItems} from '../helper/selection';
import {clearSelection, getSelectedLeafItems, getSelectedRootItems, getAllRootItems} from '../helper/selection';
import {HANDLE_RATIO, ensureClockwise} from '../helper/math';

class ModeTools extends React.Component {
Expand All @@ -17,7 +16,6 @@ class ModeTools extends React.Component {
bindAll(this, [
'_getSelectedUncurvedPoints',
'_getSelectedUnpointedPoints',
'hasItems',
'hasSelectedUncurvedPoints',
'hasSelectedUnpointedPoints',
'handleCopyToClipboard',
Expand Down Expand Up @@ -70,9 +68,6 @@ class ModeTools extends React.Component {
const points = this._getSelectedUnpointedPoints();
return points.length > 0;
}
hasItems () {
return getAllSelectableRootItems().length > 0;
}
handleCurvePoints () {
let changed;
const points = this._getSelectedUncurvedPoints();
Expand Down Expand Up @@ -208,7 +203,6 @@ class ModeTools extends React.Component {
render () {
return (
<ModeToolsComponent
hasItems={this.hasItems()}
hasSelectedUncurvedPoints={this.hasSelectedUncurvedPoints()}
hasSelectedUnpointedPoints={this.hasSelectedUnpointedPoints()}
onCopyToClipboard={this.handleCopyToClipboard}
Expand Down
1 change: 0 additions & 1 deletion src/helper/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ const shouldShowSelectAll = function () {
export {
getItems,
getAllRootItems,
getAllSelectableRootItems,
selectAllItems,
selectAllSegments,
clearSelection,
Expand Down

0 comments on commit c9165b0

Please sign in to comment.