Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #12035 from petetnt/petetnt/update-react
Browse files Browse the repository at this point in the history
Update React to 0.14.7 and Immutable to 3.7.6.
  • Loading branch information
MiguelCastillo committed Feb 14, 2016
2 parents 8e49f35 + 71d1442 commit b87b196
Show file tree
Hide file tree
Showing 7 changed files with 9,821 additions and 10,523 deletions.
4 changes: 3 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ require.config({
paths: {
"text" : "thirdparty/text/text",
"i18n" : "thirdparty/i18n/i18n",
"react" : "thirdparty/react",

// The file system implementation. Change this value to use different
// implementations (e.g. cloud-based storage).
"fileSystemImpl" : "filesystem/impls/appshell/AppshellFileSystem"
},
map: {
"*": {
"thirdparty/CodeMirror2": "thirdparty/CodeMirror"
"thirdparty/CodeMirror2": "thirdparty/CodeMirror",
"thirdparty/react": "react"
}
}
});
Expand Down
21 changes: 11 additions & 10 deletions src/project/FileTreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ define(function (require, exports, module) {
"use strict";

var React = require("thirdparty/react"),
ReactDOM = require("thirdparty/react-dom"),
Classnames = require("thirdparty/classnames"),
Immutable = require("thirdparty/immutable"),
_ = require("thirdparty/lodash"),
Expand Down Expand Up @@ -141,14 +142,14 @@ define(function (require, exports, module) {
* this component, so we keep the model up to date by sending every update via an action.
*/
handleInput: function (e) {
this.props.actions.setRenameValue(this.refs.name.getDOMNode().value.trim());
this.props.actions.setRenameValue(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 domNode = this.refs.name.getDOMNode(),
newWidth = _measureText(domNode.value);
$(domNode).width(newWidth);
var node = this.refs.name,
newWidth = _measureText(node.value);
$(node).width(newWidth);
}
},

Expand Down Expand Up @@ -181,7 +182,7 @@ define(function (require, exports, module) {
var fullname = this.props.name,
extension = LanguageManager.getCompoundFileExtension(fullname);

var node = this.refs.name.getDOMNode();
var node = this.refs.name;
node.setSelectionRange(0, _getName(fullname, extension).length);
ViewUtils.scrollElementIntoView($("#project-files-container"), $(node), true);
},
Expand Down Expand Up @@ -362,7 +363,7 @@ define(function (require, exports, module) {
// 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"), $(this.getDOMNode()), true);
ViewUtils.scrollElementIntoView($("#project-files-container"), $(ReactDOM.findDOMNode(this)), true);
} else if (!isSelected && wasSelected && this.state.clickTimer !== null) {
this.clearTimer();
}
Expand Down Expand Up @@ -554,7 +555,7 @@ define(function (require, exports, module) {
componentDidMount: function () {
var fullname = this.props.name;

var node = this.refs.name.getDOMNode();
var node = this.refs.name;
node.setSelectionRange(0, fullname.length);
ViewUtils.scrollElementIntoView($("#project-files-container"), $(node), true);
},
Expand Down Expand Up @@ -810,7 +811,7 @@ define(function (require, exports, module) {
return;
}

var node = this.getDOMNode(),
var node = ReactDOM.findDOMNode(this),
selectedNode = $(node.parentNode).find(this.props.selectedClassName),
selectionViewInfo = this.props.selectionViewInfo;

Expand Down Expand Up @@ -865,7 +866,7 @@ define(function (require, exports, module) {
return;
}

var node = this.getDOMNode(),
var node = ReactDOM.findDOMNode(this),
selectedNode = $(node.parentNode).find(this.props.selectedClassName),
selectionViewInfo = this.props.selectionViewInfo;

Expand Down Expand Up @@ -1012,7 +1013,7 @@ define(function (require, exports, module) {
return;
}

React.render(fileTreeView({
ReactDOM.render(fileTreeView({
treeData: viewModel.treeData,
selectionViewInfo: viewModel.selectionViewInfo,
sortDirectoriesFirst: viewModel.sortDirectoriesFirst,
Expand Down
Loading

0 comments on commit b87b196

Please sign in to comment.