summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-08-11 09:48:25 -0700
committerReed Garmsen <rgarmsen2295@gmail.com>2015-08-12 12:29:57 -0700
commit9baafdb372d92c96a4063f11531f4fb5d9e7059e (patch)
tree02b99fbbc104d68cdbf5a836a1a892fd13e3d80e
parent81d7599f75b11d619f8ee9440394de3f9f86f39f (diff)
downloadchat-9baafdb372d92c96a4063f11531f4fb5d9e7059e.tar.gz
chat-9baafdb372d92c96a4063f11531f4fb5d9e7059e.tar.bz2
chat-9baafdb372d92c96a4063f11531f4fb5d9e7059e.zip
Changed structure to keep code contained to file_upload.jsx
-rw-r--r--web/react/components/file_upload.jsx26
-rw-r--r--web/react/components/post_list.jsx6
-rw-r--r--web/react/components/post_right.jsx6
-rw-r--r--web/sass-files/sass/partials/_files.scss12
-rw-r--r--web/sass-files/sass/partials/_post_right.scss6
5 files changed, 28 insertions, 28 deletions
diff --git a/web/react/components/file_upload.jsx b/web/react/components/file_upload.jsx
index a479883c9..e082abcd2 100644
--- a/web/react/components/file_upload.jsx
+++ b/web/react/components/file_upload.jsx
@@ -113,31 +113,33 @@ module.exports = React.createClass({
var self = this;
if (this.props.postType === 'post') {
- $('body').on('dragover', '.post-list__table', function(e) {
+ $('body').on('dragover dragleave', '.app__content', function(e) {
e.preventDefault();
});
- $('body').on('dragenter', '.post-list__table', function(e) {
+ $('body').on('dragenter', '.app__content', function(e) {
e.preventDefault();
+ console.log('HERE');
+ $('.app__content').addClass('center-file-overlay');
+ $('.post-right__container').removeClass('right-file-overlay');
});
- $('body').on('dragleave', '.post-list__table', function(e) {
- e.preventDefault();
- });
- $('body').on('drop', '.post-list__table', function(e) {
+ $('body').on('drop', '.app__content', function(e) {
e.preventDefault();
+ $('.app__content').removeClass('center-file-overlay');
self.handleDrop(e);
});
} else if (this.props.postType === 'comment') {
- $('body').on('dragover', '.sidebar--right', function(e) {
- e.preventDefault();
- });
- $('body').on('dragenter', '.sidebar--right', function(e) {
+ $('body').on('dragover dragleave', '.post-right__container', function(e) {
e.preventDefault();
});
- $('body').on('dragleave', '.sidebar--right', function(e) {
+ $('body').on('dragenter', '.post-right__container', function(e) {
e.preventDefault();
+ console.log('HERE RIGHT');
+ $('.post-right__container').addClass('right-file-overlay');
+ $('.app__content').removeClass('center-file-overlay');
});
- $('body').on('drop', '.sidebar--right', function(e) {
+ $('body').on('drop', '.post-right__container', function(e) {
e.preventDefault();
+ $('.post-right__container').removeClass('right-file-overlay');
self.handleDrop(e);
});
}
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index cf0c4c663..826d34a7d 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -280,10 +280,6 @@ module.exports = React.createClass({
}
);
},
- handleDragEnter: function() {
- console.log("HERE ENTER");
- this.setState({fileDrag: true});
- },
getInitialState: function() {
return getStateFromStores();
},
@@ -472,7 +468,7 @@ module.exports = React.createClass({
return (
<div ref="postlist" className="post-list-holder-by-time">
- <div className={"post-list__table " + fileDragOverlay} onDragEnter={this.handleDragEnter}>
+ <div className="post-list__table">
<div className="post-list__content">
{ more_messages }
{ postCtls }
diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx
index f7f5ed509..ad993aee1 100644
--- a/web/react/components/post_right.jsx
+++ b/web/react/components/post_right.jsx
@@ -243,10 +243,6 @@ module.exports = React.createClass({
this.refs[id].forceUpdate();
}
},
- handleDragEnter: function() {
- console.log("HERE ENTER RIGHT");
- this.setState({fileDrag: true});
- },
getInitialState: function() {
return getStateFromStores();
},
@@ -304,7 +300,7 @@ module.exports = React.createClass({
}
return (
- <div className={"post-right__container" + fileDragOverlay} onDragEnter={this.handleDragEnter}>
+ <div className="post-right__container ">
<div className="search-bar__container sidebar--right__search-header">{searchForm}</div>
<div className="sidebar-right__body">
<RhsHeaderPost fromSearch={this.props.fromSearch} isMentionSearch={this.props.isMentionSearch} />
diff --git a/web/sass-files/sass/partials/_files.scss b/web/sass-files/sass/partials/_files.scss
index 34409d563..83c87132b 100644
--- a/web/sass-files/sass/partials/_files.scss
+++ b/web/sass-files/sass/partials/_files.scss
@@ -202,3 +202,15 @@
}
}
}
+
+.center-file-overlay {
+ width: 100%;
+ height: 100%;
+ background:rgba(255,255,255,0.5);
+}
+
+.right-file-overlay {
+ width: 100%;
+ height: 100%;
+ background:rgba(255,255,255,0.5);
+}
diff --git a/web/sass-files/sass/partials/_post_right.scss b/web/sass-files/sass/partials/_post_right.scss
index 1b98d62f9..4cf3e32a1 100644
--- a/web/sass-files/sass/partials/_post_right.scss
+++ b/web/sass-files/sass/partials/_post_right.scss
@@ -1,11 +1,5 @@
.post-right__container {
- .post-right-file-overlay {
- width: 100%;
- height: 100%;
- background:rgba(255,255,255,0.5);
- }
-
.post-right-root-message {
padding: 1em 1em 0;
}