Replaced broken remaining calls to getDOMNode with React.findDOMNode
Этот коммит содержится в:
@@ -15,7 +15,7 @@ export default class CommandList extends React.Component {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
var self = this;
|
var self = this;
|
||||||
if (this.refs.modal) {
|
if (this.refs.modal) {
|
||||||
$(this.refs.modal.getDOMNode()).on('show.bs.modal', function show(e) {
|
$(React.findDOMNode(this.refs.modal).on('show.bs.modal', function show(e) {
|
||||||
var button = e.relatedTarget;
|
var button = e.relatedTarget;
|
||||||
self.setState({channel_id: $(button).attr('data-channelid')});
|
self.setState({channel_id: $(button).attr('data-channelid')});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default class FileUpload extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleChange() {
|
handleChange() {
|
||||||
var element = $(this.refs.fileInput.getDOMNode());
|
var element = $(React.findDOMNode(this.refs.fileInput));
|
||||||
var files = element.prop('files');
|
var files = element.prop('files');
|
||||||
|
|
||||||
var channelId = this.props.channelId || ChannelStore.getCurrentId();
|
var channelId = this.props.channelId || ChannelStore.getCurrentId();
|
||||||
@@ -149,7 +149,7 @@ export default class FileUpload extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
var inputDiv = this.refs.input.getDOMNode();
|
var inputDiv = React.findDOMNode(this.refs.input);
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
if (this.props.postType === 'post') {
|
if (this.props.postType === 'post') {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default class FindTeam extends React.Component {
|
|||||||
|
|
||||||
var state = { };
|
var state = { };
|
||||||
|
|
||||||
var email = this.refs.email.getDOMNode().value.trim().toLowerCase();
|
var email = React.findDOMNode(this.refs.email).value.trim().toLowerCase();
|
||||||
if (!email || !utils.isEmail(email)) {
|
if (!email || !utils.isEmail(email)) {
|
||||||
state.email_error = 'Please enter a valid email address';
|
state.email_error = 'Please enter a valid email address';
|
||||||
this.setState(state);
|
this.setState(state);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
var notEmpty = false;
|
var notEmpty = false;
|
||||||
for (var i = 0; i < self.state.inviteIds.length; i++) {
|
for (var i = 0; i < self.state.inviteIds.length; i++) {
|
||||||
var index = self.state.inviteIds[i];
|
var index = self.state.inviteIds[i];
|
||||||
if (self.refs['email' + index].getDOMNode().value.trim() !== '') {
|
if (React.findDOMNode(self.refs['email' + index]).value.trim() !== '') {
|
||||||
notEmpty = true;
|
notEmpty = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
for (var i = 0; i < count; i++) {
|
for (var i = 0; i < count; i++) {
|
||||||
var index = inviteIds[i];
|
var index = inviteIds[i];
|
||||||
var invite = {};
|
var invite = {};
|
||||||
invite.email = this.refs['email' + index].getDOMNode().value.trim();
|
invite.email = React.findDOMNode(this.refs['email' + index]).value.trim();
|
||||||
if (!invite.email || !utils.isEmail(invite.email)) {
|
if (!invite.email || !utils.isEmail(invite.email)) {
|
||||||
emailErrors[index] = 'Please enter a valid email address';
|
emailErrors[index] = 'Please enter a valid email address';
|
||||||
valid = false;
|
valid = false;
|
||||||
@@ -79,7 +79,7 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (config.AllowInviteNames) {
|
if (config.AllowInviteNames) {
|
||||||
invite.firstName = this.refs['first_name' + index].getDOMNode().value.trim();
|
invite.firstName = React.findDOMNode(this.refs['first_name' + index]).value.trim();
|
||||||
if (!invite.firstName && config.RequireInviteNames) {
|
if (!invite.firstName && config.RequireInviteNames) {
|
||||||
firstNameErrors[index] = 'This is a required field';
|
firstNameErrors[index] = 'This is a required field';
|
||||||
valid = false;
|
valid = false;
|
||||||
@@ -87,7 +87,7 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
firstNameErrors[index] = '';
|
firstNameErrors[index] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
invite.lastName = this.refs['last_name' + index].getDOMNode().value.trim();
|
invite.lastName = React.findDOMNode(this.refs['last_name' + index]).value.trim();
|
||||||
if (!invite.lastName && config.RequireInviteNames) {
|
if (!invite.lastName && config.RequireInviteNames) {
|
||||||
lastNameErrors[index] = 'This is a required field';
|
lastNameErrors[index] = 'This is a required field';
|
||||||
valid = false;
|
valid = false;
|
||||||
@@ -110,8 +110,8 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
|
|
||||||
Client.inviteMembers(data,
|
Client.inviteMembers(data,
|
||||||
function success() {
|
function success() {
|
||||||
$(this.refs.modal.getDOMNode()).attr('data-confirm', 'true');
|
$(React.findDOMNode(this.refs.modal)).attr('data-confirm', 'true');
|
||||||
$(this.refs.modal.getDOMNode()).modal('hide');
|
$(React.findDOMNode(this.refs.modal)).modal('hide');
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
function fail(err) {
|
function fail(err) {
|
||||||
if (err.message === 'This person is already on your team') {
|
if (err.message === 'This person is already on your team') {
|
||||||
@@ -125,8 +125,8 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate() {
|
||||||
$(this.refs.modalBody.getDOMNode()).css('max-height', $(window).height() - 200);
|
$(React.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 200);
|
||||||
$(this.refs.modalBody.getDOMNode()).css('overflow-y', 'scroll');
|
$(React.findDOMNode(this.refs.modalBody)).css('overflow-y', 'scroll');
|
||||||
}
|
}
|
||||||
|
|
||||||
addInviteFields() {
|
addInviteFields() {
|
||||||
@@ -141,10 +141,10 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
|
|
||||||
for (var i = 0; i < inviteIds.length; i++) {
|
for (var i = 0; i < inviteIds.length; i++) {
|
||||||
var index = inviteIds[i];
|
var index = inviteIds[i];
|
||||||
this.refs['email' + index].getDOMNode().value = '';
|
React.findDOMNode(this.refs['email' + index]).value = '';
|
||||||
if (config.AllowInviteNames) {
|
if (config.AllowInviteNames) {
|
||||||
this.refs['first_name' + index].getDOMNode().value = '';
|
React.findDOMNode(this.refs['first_name' + index]).value = '';
|
||||||
this.refs['last_name' + index].getDOMNode().value = '';
|
React.findDOMNode(this.refs['last_name' + index]).value = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ export default class MoreChannels extends React.Component {
|
|||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
ChannelStore.addMoreChangeListener(this.onListenerChange);
|
ChannelStore.addMoreChangeListener(this.onListenerChange);
|
||||||
$(this.refs.modal.getDOMNode()).on('shown.bs.modal', function shown() {
|
$(React.findDOMNode(this.refs.modal)).on('shown.bs.modal', function shown() {
|
||||||
asyncClient.getMoreChannels(true);
|
asyncClient.getMoreChannels(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
$(this.refs.modal.getDOMNode()).on('show.bs.modal', function show(e) {
|
$(React.findDOMNode(this.refs.modal)).on('show.bs.modal', function show(e) {
|
||||||
var button = e.relatedTarget;
|
var button = e.relatedTarget;
|
||||||
self.setState({channelType: $(button).attr('data-channeltype')});
|
self.setState({channelType: $(button).attr('data-channeltype')});
|
||||||
});
|
});
|
||||||
@@ -52,7 +52,7 @@ export default class MoreChannels extends React.Component {
|
|||||||
this.setState({joiningChannel: channelIndex});
|
this.setState({joiningChannel: channelIndex});
|
||||||
client.joinChannel(channel.id,
|
client.joinChannel(channel.id,
|
||||||
function joinSuccess() {
|
function joinSuccess() {
|
||||||
$(this.refs.modal.getDOMNode()).modal('hide');
|
$(React.findDOMNode(this.refs.modal)).modal('hide');
|
||||||
asyncClient.getChannel(channel.id);
|
asyncClient.getChannel(channel.id);
|
||||||
utils.switchChannel(channel);
|
utils.switchChannel(channel);
|
||||||
this.setState({joiningChannel: -1});
|
this.setState({joiningChannel: -1});
|
||||||
@@ -65,7 +65,7 @@ export default class MoreChannels extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
handleNewChannel() {
|
handleNewChannel() {
|
||||||
$(this.refs.modal.getDOMNode()).modal('hide');
|
$(React.findDOMNode(this.refs.modal)).modal('hide');
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
var serverError;
|
var serverError;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export default class MoreDirectChannels extends React.Component {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
var self = this;
|
var self = this;
|
||||||
$(this.refs.modal.getDOMNode()).on('show.bs.modal', function showModal(e) {
|
$(React.findDOMNode(this.refs.modal)).on('show.bs.modal', function showModal(e) {
|
||||||
var button = e.relatedTarget;
|
var button = e.relatedTarget;
|
||||||
self.setState({channels: $(button).data('channels')});
|
self.setState({channels: $(button).data('channels')});
|
||||||
});
|
});
|
||||||
@@ -44,7 +44,7 @@ export default class MoreDirectChannels extends React.Component {
|
|||||||
handleClick = function clickHandler(e) {
|
handleClick = function clickHandler(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
utils.switchChannel(channel, channel.teammate_username);
|
utils.switchChannel(channel, channel.teammate_username);
|
||||||
$(self.refs.modal.getDOMNode()).modal('hide');
|
$(React.findDOMNode(self.refs.modal)).modal('hide');
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// It's a direct message channel that doesn't exist yet so let's create it now
|
// It's a direct message channel that doesn't exist yet so let's create it now
|
||||||
@@ -66,7 +66,7 @@ export default class MoreDirectChannels extends React.Component {
|
|||||||
|
|
||||||
Client.createDirectChannel(channel, otherUserId,
|
Client.createDirectChannel(channel, otherUserId,
|
||||||
function success(data) {
|
function success(data) {
|
||||||
$(self.refs.modal.getDOMNode()).modal('hide');
|
$(React.findDOMNode(self.refs.modal)).modal('hide');
|
||||||
self.setState({loadingDMChannel: -1});
|
self.setState({loadingDMChannel: -1});
|
||||||
AsyncClient.getChannel(data.id);
|
AsyncClient.getChannel(data.id);
|
||||||
utils.switchChannel(data);
|
utils.switchChannel(data);
|
||||||
|
|||||||
@@ -577,14 +577,14 @@ export default class PostList extends React.Component {
|
|||||||
var order = this.state.postList.order;
|
var order = this.state.postList.order;
|
||||||
var channelId = this.state.channel.id;
|
var channelId = this.state.channel.id;
|
||||||
|
|
||||||
$(this.refs.loadmore.getDOMNode()).text('Retrieving more messages...');
|
$(React.findDOMNode(this.refs.loadmore)).text('Retrieving more messages...');
|
||||||
|
|
||||||
Client.getPostsPage(
|
Client.getPostsPage(
|
||||||
channelId,
|
channelId,
|
||||||
order.length,
|
order.length,
|
||||||
Constants.POST_CHUNK_SIZE,
|
Constants.POST_CHUNK_SIZE,
|
||||||
function success(data) {
|
function success(data) {
|
||||||
$(this.refs.loadmore.getDOMNode()).text('Load more messages');
|
$(React.findDOMNode(this.refs.loadmore)).text('Load more messages');
|
||||||
this.gotMorePosts = true;
|
this.gotMorePosts = true;
|
||||||
this.setState({numToDisplay: this.state.numToDisplay + Constants.POST_CHUNK_SIZE});
|
this.setState({numToDisplay: this.state.numToDisplay + Constants.POST_CHUNK_SIZE});
|
||||||
|
|
||||||
@@ -609,7 +609,7 @@ export default class PostList extends React.Component {
|
|||||||
Client.getProfiles();
|
Client.getProfiles();
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
function fail(err) {
|
function fail(err) {
|
||||||
$(this.refs.loadmore.getDOMNode()).text('Load more messages');
|
$(React.findDOMNode(this.refs.loadmore)).text('Load more messages');
|
||||||
AsyncClient.dispatchError(err, 'getPosts');
|
AsyncClient.dispatchError(err, 'getPosts');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
@@ -667,4 +667,4 @@ export default class PostList extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default class SettingPicture extends React.Component {
|
|||||||
if (file) {
|
if (file) {
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
|
|
||||||
var img = this.refs.image.getDOMNode();
|
var img = React.findDOMNode(this.refs.image);
|
||||||
reader.onload = function load(e) {
|
reader.onload = function load(e) {
|
||||||
$(img).attr('src', e.target.result);
|
$(img).attr('src', e.target.result);
|
||||||
};
|
};
|
||||||
@@ -128,4 +128,4 @@ SettingPicture.propTypes = {
|
|||||||
submit: React.PropTypes.func,
|
submit: React.PropTypes.func,
|
||||||
title: React.PropTypes.string,
|
title: React.PropTypes.string,
|
||||||
pictureChange: React.PropTypes.func
|
pictureChange: React.PropTypes.func
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export default class SettingsUpload extends React.Component {
|
|||||||
|
|
||||||
doSubmit(e) {
|
doSubmit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var inputnode = this.refs.uploadinput.getDOMNode();
|
var inputnode = React.findDOMNode(this.refs.uploadinput);
|
||||||
if (inputnode.files && inputnode.files[0]) {
|
if (inputnode.files && inputnode.files[0]) {
|
||||||
this.props.submit(inputnode.files[0]);
|
this.props.submit(inputnode.files[0]);
|
||||||
} else {
|
} else {
|
||||||
@@ -98,4 +98,4 @@ SettingsUpload.propTypes = {
|
|||||||
clientError: React.PropTypes.string,
|
clientError: React.PropTypes.string,
|
||||||
serverError: React.PropTypes.string,
|
serverError: React.PropTypes.string,
|
||||||
helpText: React.PropTypes.object
|
helpText: React.PropTypes.object
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ export default class TeamMembers extends React.Component {
|
|||||||
UserStore.addChangeListener(this.onChange);
|
UserStore.addChangeListener(this.onChange);
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
$(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function show() {
|
$(React.findDOMNode(this.refs.modal)).on('hidden.bs.modal', function show() {
|
||||||
self.setState({render_members: false});
|
self.setState({render_members: false});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(this.refs.modal.getDOMNode()).on('show.bs.modal', function hide() {
|
$(React.findDOMNOde(this.refs.modal)).on('show.bs.modal', function hide() {
|
||||||
self.setState({render_members: true});
|
self.setState({render_members: true});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export default class SSOSignUpPage extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
nameChange() {
|
nameChange() {
|
||||||
this.setState({name: this.refs.teamname.getDOMNode().value.trim()});
|
this.setState({name: React.findDOMNode(this.refs.teamname).value.trim()});
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
var nameError = null;
|
var nameError = null;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user