src/project/FileTreeView.js
function (prevProps, prevState) {
            var wasSelected = prevProps.entry.get("selected"),
                isSelected  = this.props.entry.get("selected");

            if (isSelected && !wasSelected) {
                // TODO: This shouldn't really know about project-files-container
                // directly. It is probably the case that our Preact tree should actually
                // start with project-files-container instead of just the interior of
                // project-files-container and then the file tree will be one self-contained
                // functional unit.
                ViewUtils.scrollElementIntoView($("#project-files-container"), $(Preact.findDOMNode(this)), true);
            } else if (!isSelected && wasSelected && this.state.clickTimer !== null) {
                this.clearTimer();
            }
        }
function (prevProps, prevState) {
            var wasSelected = prevProps.entry.get("selected"),
                isSelected  = this.props.entry.get("selected");

            if (isSelected && !wasSelected) {
                // TODO: This shouldn't really know about project-files-container
                // directly. It is probably the case that our Preact tree should actually
                // start with project-files-container instead of just the interior of
                // project-files-container and then the file tree will be one self-contained
                // functional unit.
                ViewUtils.scrollElementIntoView($("#project-files-container"), $(Preact.findDOMNode(this)), true);
            } else if (!isSelected && wasSelected && this.state.clickTimer !== null) {
                this.clearTimer();
            }
        }
function ( prevProps , prevState ) { var wasSelected = prevProps . entry . get ( "selected" ) , isSelected = this . props . entry . get ( "selected" ) ; if ( isSelected && ! wasSelected ) { // TODO: This shouldn't really know about project-files-container // directly. It is probably the case that our Preact tree should actually // start with project-files-container instead of just the interior of // project-files-container and then the file tree will be one self-contained // functional unit. ViewUtils . scrollElementIntoView ( $ ( "#project-files-container" ) , $ ( Preact . findDOMNode ( this ) ) , true ) ; } else if ( ! isSelected && wasSelected && this . state . clickTimer !== null ) { this . clearTimer ( ) ; } }
If this node is newly selected, scroll it into view. Also, move the selection or
context boxes as appropriate.
If this node is newly selected scroll it into view . Also move the selection or context boxes as appropriate .