diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2016-01-08 09:25:44 -0500 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2016-01-08 09:25:44 -0500 |
commit | c2f7aadfa7fad3e6058af5c3be6d40d48727d8ac (patch) | |
tree | b583f0cda9101b361fe35e148114aae1aa048ded /web | |
parent | 5e9dde6a4cdec89bbc234830c7bd17a717f29baf (diff) | |
download | chat-c2f7aadfa7fad3e6058af5c3be6d40d48727d8ac.tar.gz chat-c2f7aadfa7fad3e6058af5c3be6d40d48727d8ac.tar.bz2 chat-c2f7aadfa7fad3e6058af5c3be6d40d48727d8ac.zip |
Fixed FileUpload to properly unbind drag handlers when unmounted
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/file_upload.jsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/web/react/components/file_upload.jsx b/web/react/components/file_upload.jsx index 8c7353e86..a0c930ffb 100644 --- a/web/react/components/file_upload.jsx +++ b/web/react/components/file_upload.jsx @@ -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]; |