Этот коммит содержится в:
Saturnino Abril
2017-07-06 04:21:04 +08:00
коммит произвёл Joram Wilander
родитель 4efb0f37b7
Коммит 81a893b556
10 изменённых файлов: 155 добавлений и 82 удалений

Просмотреть файл

@@ -51,7 +51,6 @@ class FileUpload extends React.Component {
this.pasteUpload = this.pasteUpload.bind(this);
this.keyUpload = this.keyUpload.bind(this);
this.handleMaxUploadReached = this.handleMaxUploadReached.bind(this);
this.emojiClick = this.emojiClick.bind(this);
this.state = {
requests: {}
@@ -230,10 +229,6 @@ class FileUpload extends React.Component {
target.off('dragenter dragleave dragover drop dragster:enter dragster:leave dragster:over dragster:drop');
}
emojiClick() {
this.props.onEmojiClick();
}
pasteUpload(e) {
const {formatMessage} = this.props.intl;
@@ -377,19 +372,8 @@ class FileUpload extends React.Component {
}
const channelId = this.props.channelId || ChannelStore.getCurrentId();
const uploadsRemaining = Constants.MAX_UPLOAD_FILES - this.props.getFileCount(channelId);
let emojiSpan;
if (this.props.emojiEnabled) {
emojiSpan = (
<span
className={'fa fa-smile-o icon--emoji-picker emoji-' + this.props.navBarName}
onClick={this.emojiClick}
/>
);
}
let fileDiv;
if (global.window.mm_config.EnableFileAttachments === 'true') {
fileDiv = (
@@ -413,10 +397,9 @@ class FileUpload extends React.Component {
return (
<span
ref='input'
className={'btn btn-file' + (uploadsRemaining <= 0 ? ' btn-file__disabled' : '')}
className={uploadsRemaining <= 0 ? ' btn-file__disabled' : ''}
>
{fileDiv}
{emojiSpan}
</span>
);
}
@@ -433,10 +416,7 @@ FileUpload.propTypes = {
onFileUploadChange: PropTypes.func,
onTextDrop: PropTypes.func,
channelId: PropTypes.string,
postType: PropTypes.string,
onEmojiClick: PropTypes.func,
navBarName: PropTypes.string,
emojiEnabled: PropTypes.bool
postType: PropTypes.string
};
export default injectIntl(FileUpload, {withRef: true});