summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-05-09 11:58:00 -0400
committerCorey Hulen <corey@hulen.com>2016-05-09 08:58:00 -0700
commit23f6cdf3aa0e4c3f17151c615084b0360b0674a3 (patch)
treef195c9c411a66a039146611624a6ee944371ad75 /webapp
parent12cc9def7beac97ab2b0beae946e19c5eb65e144 (diff)
downloadchat-23f6cdf3aa0e4c3f17151c615084b0360b0674a3.tar.gz
chat-23f6cdf3aa0e4c3f17151c615084b0360b0674a3.tar.bz2
chat-23f6cdf3aa0e4c3f17151c615084b0360b0674a3.zip
PLT-2814 Fixed JavaScript errors upon paste (#2932)
* Fixed JavaScript errors on paste * Reverted keycode * Removed all mentions of self * Find and replace got a comment * Fixed file upload on drag and drop
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/file_upload.jsx19
1 files changed, 9 insertions, 10 deletions
diff --git a/webapp/components/file_upload.jsx b/webapp/components/file_upload.jsx
index 5734dc01e..05f1701a8 100644
--- a/webapp/components/file_upload.jsx
+++ b/webapp/components/file_upload.jsx
@@ -132,7 +132,6 @@ class FileUpload extends React.Component {
componentDidMount() {
var self = this;
-
if (this.props.postType === 'post') {
$('.row.main').dragster({
enter(dragsterEvent, e) {
@@ -210,7 +209,7 @@ class FileUpload extends React.Component {
return;
}
- self.props.onUploadError(null);
+ this.props.onUploadError(null);
// This looks redundant, but must be done this way due to
// setState being an asynchronous call
@@ -229,10 +228,10 @@ class FileUpload extends React.Component {
}
}
- var numToUpload = Math.min(Constants.MAX_UPLOAD_FILES - self.props.getFileCount(ChannelStore.getCurrentId()), numItems);
+ var numToUpload = Math.min(Constants.MAX_UPLOAD_FILES - this.props.getFileCount(ChannelStore.getCurrentId()), numItems);
if (numItems > numToUpload) {
- self.props.onUploadError(formatMessage(holders.limited, {count: Constants.MAX_UPLOAD_FILES}));
+ this.props.onUploadError(formatMessage(holders.limited, {count: Constants.MAX_UPLOAD_FILES}));
}
for (var i = 0; i < items.length && i < numToUpload; i++) {
@@ -244,7 +243,7 @@ class FileUpload extends React.Component {
if (Constants.IMAGE_TYPES.indexOf(ext) < 0) {
continue;
}
- var channelId = self.props.channelId || ChannelStore.getCurrentId();
+ var channelId = this.props.channelId || ChannelStore.getCurrentId();
// generate a unique id that can be used by other components to refer back to this file upload
var clientId = Utils.generateId();
@@ -269,15 +268,15 @@ class FileUpload extends React.Component {
name,
channelId,
clientId,
- self.fileUploadSuccess.bind(self, channelId),
- self.fileUploadFail.bind(self, clientId)
+ this.fileUploadSuccess.bind(this, channelId),
+ this.fileUploadFail.bind(this, clientId)
);
- const requests = self.state.requests;
+ const requests = this.state.requests;
requests[clientId] = request;
- self.setState({requests});
+ this.setState({requests});
- self.props.onUploadStart([clientId], channelId);
+ this.props.onUploadStart([clientId], channelId);
}
}
}