src/project/FileTreeView.js
function (e) {
            this.props.actions.setRenameValue(this.props.parentPath + this.refs.name.value.trim());

            if (e.keyCode !== KeyEvent.DOM_VK_LEFT &&
                    e.keyCode !== KeyEvent.DOM_VK_RIGHT) {
                // update the width of the input field
                var node = this.refs.name,
                    newWidth = _measureText(node.value);
                $(node).width(newWidth);
            }
        }
function (e) {
            this.props.actions.setRenameValue(this.props.parentPath + this.refs.name.value.trim());

            if (e.keyCode !== KeyEvent.DOM_VK_LEFT &&
                    e.keyCode !== KeyEvent.DOM_VK_RIGHT) {
                // update the width of the input field
                var node = this.refs.name,
                    newWidth = _measureText(node.value);
                $(node).width(newWidth);
            }
        }
function ( e ) { this . props . actions . setRenameValue ( this . props . parentPath + this . refs . name . value . trim ( ) ) ; if ( e . keyCode !== KeyEvent . DOM_VK_LEFT && e . keyCode !== KeyEvent . DOM_VK_RIGHT ) { // update the width of the input field var node = this . refs . name , newWidth = _measureText ( node . value ) ; $ ( node ) . width ( newWidth ) ; } }
The rename or create operation can be completed or canceled by actions outside of
this component, so we keep the model up to date by sending every update via an action.
The rename or create operation can be completed or canceled by actions outside of this component so we keep the model up to date by sending every update via an action .