Merge pull request #1836 from hmhealey/plt1578

PLT-1578 Fixed FileUpload to properly unbind drag handlers when unmounted
Этот коммит содержится в:
Christopher Speller
2016-01-08 12:10:49 -05:00
родитель 5e9dde6a4c c2f7aadfa7
Коммит 4274ffebd0

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

@@ -243,6 +243,18 @@ export default class FileUpload extends React.Component {
});
}
componentWillUnmount() {
let target;
if (this.props.postType === 'post') {
target = $('.row.main');
} else {
target = $('.post-right__container');
}
// jquery-dragster doesn't provide a function to unregister itself so do it manually
target.off('dragenter dragleave dragover drop dragster:enter dragster:leave dragster:over dragster:drop');
}
cancelUpload(clientId) {
var requests = this.state.requests;
var request = requests[clientId];