diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-01-08 12:10:49 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-01-08 12:10:49 -0500 |
commit | 4274ffebd0354c64c76f4b3c9054f3105fc61308 (patch) | |
tree | b583f0cda9101b361fe35e148114aae1aa048ded /web/react | |
parent | 5e9dde6a4cdec89bbc234830c7bd17a717f29baf (diff) | |
parent | c2f7aadfa7fad3e6058af5c3be6d40d48727d8ac (diff) | |
download | chat-4274ffebd0354c64c76f4b3c9054f3105fc61308.tar.gz chat-4274ffebd0354c64c76f4b3c9054f3105fc61308.tar.bz2 chat-4274ffebd0354c64c76f4b3c9054f3105fc61308.zip |
Merge pull request #1836 from hmhealey/plt1578
PLT-1578 Fixed FileUpload to properly unbind drag handlers when unmounted
Diffstat (limited to 'web/react')
-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]; |