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>
<InputGroup className={classNames(styles.modLabeledIconHeight)}> <InputGroup className={classNames(styles.modLabeledIconHeight)}>
<LabeledIconButton <LabeledIconButton
disabled={!props.hasItems}
imgSrc={flipHorizontalIcon} imgSrc={flipHorizontalIcon}
title={props.intl.formatMessage(messages.flipHorizontal)} title={props.intl.formatMessage(messages.flipHorizontal)}
onClick={props.onFlipHorizontal} onClick={props.onFlipHorizontal}
/> />
<LabeledIconButton <LabeledIconButton
disabled={!props.hasItems}
imgSrc={flipVerticalIcon} imgSrc={flipVerticalIcon}
title={props.intl.formatMessage(messages.flipVertical)} title={props.intl.formatMessage(messages.flipVertical)}
onClick={props.onFlipVertical} onClick={props.onFlipVertical}
@ -178,7 +176,6 @@ ModeToolsComponent.propTypes = {
className: PropTypes.string, className: PropTypes.string,
clipboardItems: PropTypes.arrayOf(PropTypes.array), clipboardItems: PropTypes.arrayOf(PropTypes.array),
eraserValue: PropTypes.number, eraserValue: PropTypes.number,
hasItems: PropTypes.bool,
hasSelectedUncurvedPoints: PropTypes.bool, hasSelectedUncurvedPoints: PropTypes.bool,
hasSelectedUnpointedPoints: PropTypes.bool, hasSelectedUnpointedPoints: PropTypes.bool,
intl: intlShape.isRequired, intl: intlShape.isRequired,

View file

@ -7,8 +7,7 @@ import bindAll from 'lodash.bindall';
import ModeToolsComponent from '../components/mode-tools/mode-tools.jsx'; import ModeToolsComponent from '../components/mode-tools/mode-tools.jsx';
import {clearSelectedItems, setSelectedItems} from '../reducers/selected-items'; import {clearSelectedItems, setSelectedItems} from '../reducers/selected-items';
import {incrementPasteOffset, setClipboardItems} from '../reducers/clipboard'; import {incrementPasteOffset, setClipboardItems} from '../reducers/clipboard';
import {clearSelection, getSelectedLeafItems, getSelectedRootItems} from '../helper/selection'; import {clearSelection, getSelectedLeafItems, getSelectedRootItems, getAllRootItems} from '../helper/selection';
import {getAllRootItems, getAllSelectableRootItems} from '../helper/selection';
import {HANDLE_RATIO, ensureClockwise} from '../helper/math'; import {HANDLE_RATIO, ensureClockwise} from '../helper/math';
class ModeTools extends React.Component { class ModeTools extends React.Component {
@ -17,7 +16,6 @@ class ModeTools extends React.Component {
bindAll(this, [ bindAll(this, [
'_getSelectedUncurvedPoints', '_getSelectedUncurvedPoints',
'_getSelectedUnpointedPoints', '_getSelectedUnpointedPoints',
'hasItems',
'hasSelectedUncurvedPoints', 'hasSelectedUncurvedPoints',
'hasSelectedUnpointedPoints', 'hasSelectedUnpointedPoints',
'handleCopyToClipboard', 'handleCopyToClipboard',
@ -70,9 +68,6 @@ class ModeTools extends React.Component {
const points = this._getSelectedUnpointedPoints(); const points = this._getSelectedUnpointedPoints();
return points.length > 0; return points.length > 0;
} }
hasItems () {
return getAllSelectableRootItems().length > 0;
}
handleCurvePoints () { handleCurvePoints () {
let changed; let changed;
const points = this._getSelectedUncurvedPoints(); const points = this._getSelectedUncurvedPoints();
@ -208,7 +203,6 @@ class ModeTools extends React.Component {
render () { render () {
return ( return (
<ModeToolsComponent <ModeToolsComponent
hasItems={this.hasItems()}
hasSelectedUncurvedPoints={this.hasSelectedUncurvedPoints()} hasSelectedUncurvedPoints={this.hasSelectedUncurvedPoints()}
hasSelectedUnpointedPoints={this.hasSelectedUnpointedPoints()} hasSelectedUnpointedPoints={this.hasSelectedUnpointedPoints()}
onCopyToClipboard={this.handleCopyToClipboard} onCopyToClipboard={this.handleCopyToClipboard}

View file

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