Revert "Don't enable if there is nothing in the editor"

This reverts commit e4ca0482b8.
This commit is contained in:
DD 2018-01-26 17:21:47 -05:00
parent e4ca0482b8
commit c9165b0b4c
3 changed files with 1 additions and 11 deletions

View file

@ -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}
@ -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,

View file

@ -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 {
@ -17,7 +16,6 @@ class ModeTools extends React.Component {
bindAll(this, [
'_getSelectedUncurvedPoints',
'_getSelectedUnpointedPoints',
'hasItems',
'hasSelectedUncurvedPoints',
'hasSelectedUnpointedPoints',
'handleCopyToClipboard',
@ -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();
@ -208,7 +203,6 @@ class ModeTools extends React.Component {
render () {
return (
<ModeToolsComponent
hasItems={this.hasItems()}
hasSelectedUncurvedPoints={this.hasSelectedUncurvedPoints()}
hasSelectedUnpointedPoints={this.hasSelectedUnpointedPoints()}
onCopyToClipboard={this.handleCopyToClipboard}

View file

@ -400,7 +400,6 @@ const shouldShowSelectAll = function () {
export {
getItems,
getAllRootItems,
getAllSelectableRootItems,
selectAllItems,
selectAllSegments,
clearSelection,