Changed post drafts to maintain a store a unique id for each file upload to fix issues with duplicate file names
Этот коммит содержится в:
@@ -10,7 +10,12 @@ var Constants = require('../utils/constants.jsx');
|
||||
module.exports = React.createClass({
|
||||
handleRemove: function(e) {
|
||||
var previewDiv = e.target.parentNode.parentNode;
|
||||
this.props.onRemove(previewDiv.getAttribute('data-filename'));
|
||||
|
||||
if (previewDiv.hasAttribute('data-filename')) {
|
||||
this.props.onRemove(previewDiv.getAttribute('data-filename'));
|
||||
} else if (previewDiv.hasAttribute('data-client-id')) {
|
||||
this.props.onRemove(previewDiv.getAttribute('data-client-id'));
|
||||
}
|
||||
},
|
||||
render: function() {
|
||||
var previews = [];
|
||||
@@ -43,9 +48,9 @@ module.exports = React.createClass({
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
this.props.uploadsInProgress.forEach(function(filename) {
|
||||
this.props.uploadsInProgress.forEach(function(clientId) {
|
||||
previews.push(
|
||||
<div className="preview-div" data-filename={filename}>
|
||||
<div className="preview-div" data-client-id={clientId}>
|
||||
<img className="spinner" src="/static/images/load.gif"/>
|
||||
<a className="remove-preview" onClick={this.handleRemove}><i className="glyphicon glyphicon-remove"/></a>
|
||||
</div>
|
||||
|
||||
Ссылка в новой задаче
Block a user