summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2016-01-08 09:25:44 -0500
committerhmhealey <harrisonmhealey@gmail.com>2016-01-08 09:25:44 -0500
commitc2f7aadfa7fad3e6058af5c3be6d40d48727d8ac (patch)
treeb583f0cda9101b361fe35e148114aae1aa048ded /web
parent5e9dde6a4cdec89bbc234830c7bd17a717f29baf (diff)
downloadchat-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.jsx12
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];