summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-24 11:16:22 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-29 09:54:53 -0400
commit6d65071ecd1b024e0872c50749bde46b6c53b683 (patch)
tree8d09f6211748b4f0cca65e41eaf7229e025e6d12
parent92c9ec71a051e076fd1dc3985a8a1225e5389a95 (diff)
downloadchat-6d65071ecd1b024e0872c50749bde46b6c53b683.tar.gz
chat-6d65071ecd1b024e0872c50749bde46b6c53b683.tar.bz2
chat-6d65071ecd1b024e0872c50749bde46b6c53b683.zip
Removed unused imgCount property from ViewImageModal
-rw-r--r--web/react/components/file_attachment_list.jsx1
-rw-r--r--web/react/components/view_image.jsx32
2 files changed, 12 insertions, 21 deletions
diff --git a/web/react/components/file_attachment_list.jsx b/web/react/components/file_attachment_list.jsx
index 3da1e1482..5f2690fdf 100644
--- a/web/react/components/file_attachment_list.jsx
+++ b/web/react/components/file_attachment_list.jsx
@@ -35,7 +35,6 @@ module.exports = React.createClass({
userId={this.props.userId}
modalId={modalId}
startId={this.state.startImgId}
- imgCount={0}
filenames={filenames} />
</div>
);
diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx
index 7b096c629..6ba76c0f8 100644
--- a/web/react/components/view_image.jsx
+++ b/web/react/components/view_image.jsx
@@ -31,18 +31,13 @@ module.exports = React.createClass({
return;
};
- var src = "";
- if (this.props.imgCount > 0) {
- src = this.props.filenames[id];
- } else {
- var fileInfo = utils.splitFileLocation(this.props.filenames[id]);
- // This is a temporary patch to fix issue with old files using absolute paths
- if (fileInfo.path.indexOf("/api/v1/files/get") !== -1) {
- fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
- }
- fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path;
- src = fileInfo['path'] + '_preview.jpg';
+ var fileInfo = utils.splitFileLocation(this.props.filenames[id]);
+ // This is a temporary patch to fix issue with old files using absolute paths
+ if (fileInfo.path.indexOf("/api/v1/files/get") !== -1) {
+ fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
}
+ fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path;
+ var src = fileInfo['path'] + '_preview.jpg';
var self = this;
var img = new Image();
@@ -141,16 +136,13 @@ module.exports = React.createClass({
for (var id in this.state.images) {
var info = utils.splitFileLocation(this.props.filenames[id]);
var preview_filename = "";
- if (this.props.imgCount > 0) {
- preview_filename = this.props.filenames[this.state.imgId];
- } else {
- // This is a temporary patch to fix issue with old files using absolute paths
- if (info.path.indexOf("/api/v1/files/get") !== -1) {
- info.path = info.path.split("/api/v1/files/get")[1];
- }
- info.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + info.path;
- preview_filename = info['path'] + '_preview.jpg';
+
+ // This is a temporary patch to fix issue with old files using absolute paths
+ if (info.path.indexOf("/api/v1/files/get") !== -1) {
+ info.path = info.path.split("/api/v1/files/get")[1];
}
+ info.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + info.path;
+ preview_filename = info['path'] + '_preview.jpg';
var imgClass = "hidden";
if (this.state.loaded[id] && this.state.imgId == id) imgClass = "";