From fafce8cb72cc8a10b98fab22c6b3547c77d75cc9 Mon Sep 17 00:00:00 2001 From: nickago Date: Tue, 21 Jul 2015 08:03:10 -0700 Subject: Upon changing to a new comment thread, fixes the the bug of the RHS scrolling to whitespace below the pane --- web/react/components/post_right.jsx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'web/react/components/post_right.jsx') diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx index 581a1abe9..ad521adba 100644 --- a/web/react/components/post_right.jsx +++ b/web/react/components/post_right.jsx @@ -294,6 +294,8 @@ module.exports = React.createClass({ }); }, componentDidUpdate: function() { + $(".post-right__scroll").scrollTop($(".post-right__scroll")[0].scrollHeight); + $(".post-right__scroll").perfectScrollbar('update'); this.resize(); }, componentWillUnmount: function() { -- cgit v1.2.3-1-g7c22 From 29dd714d8254de13cddff133dfa00f2bb23ea7ec Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Wed, 22 Jul 2015 07:53:54 -0400 Subject: fixed thumbnails and files in RHS --- web/react/components/post_right.jsx | 49 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'web/react/components/post_right.jsx') diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx index 581a1abe9..7315266e6 100644 --- a/web/react/components/post_right.jsx +++ b/web/react/components/post_right.jsx @@ -91,28 +91,27 @@ RootPost = React.createClass({ var re2 = new RegExp('\\(', 'g'); var re3 = new RegExp('\\)', 'g'); for (var i = 0; i < filenames.length && i < Constants.MAX_DISPLAY_FILES; i++) { - var fileSplit = filenames[i].split('.'); - if (fileSplit.length < 2) continue; + var fileInfo = utils.splitFileLocation(filenames[i]); + var ftype = utils.getFileType(fileInfo.ext); - var ext = fileSplit[fileSplit.length-1]; - fileSplit.splice(fileSplit.length-1,1); - var filePath = fileSplit.join('.'); - var filename = filePath.split('/')[filePath.split('/').length-1]; - - var ftype = utils.getFileType(ext); + // 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 = window.location.origin + "/api/v1/files/get" + fileInfo.path; if (ftype === "image") { - var url = filePath.replace(re1, '%20').replace(re2, '%28').replace(re3, '%29'); + var url = fileInfo.path.replace(re1, '%20').replace(re2, '%28').replace(re3, '%29'); postFiles.push( -
-
+
+
); images.push(filenames[i]); } else { postFiles.push( -
- +
+ @@ -201,28 +200,28 @@ CommentPost = React.createClass({ var re2 = new RegExp('\\(', 'g'); var re3 = new RegExp('\\)', 'g'); for (var i = 0; i < filenames.length && i < Constants.MAX_DISPLAY_FILES; i++) { - var fileSplit = filenames[i].split('.'); - if (fileSplit.length < 2) continue; - var ext = fileSplit[fileSplit.length-1]; - fileSplit.splice(fileSplit.length-1,1) - var filePath = fileSplit.join('.'); - var filename = filePath.split('/')[filePath.split('/').length-1]; + var fileInfo = utils.splitFileLocation(filenames[i]); + var type = utils.getFileType(fileInfo.ext); - var type = utils.getFileType(ext); + // 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 = window.location.origin + "/api/v1/files/get" + fileInfo.path; if (type === "image") { - var url = filePath.replace(re1, '%20').replace(re2, '%28').replace(re3, '%29'); + var url = fileInfo.path.replace(re1, '%20').replace(re2, '%28').replace(re3, '%29'); postFiles.push( -
-
+
+
); images.push(filenames[i]); } else { postFiles.push( -
- +
+ -- cgit v1.2.3-1-g7c22 From 78666f04d02c9da27bc94cced69f1ce6d5121689 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Wed, 22 Jul 2015 21:10:00 +0500 Subject: Adjusting scroll in RHS to not show whitespace --- web/react/components/post_right.jsx | 1 + 1 file changed, 1 insertion(+) (limited to 'web/react/components/post_right.jsx') diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx index 7315266e6..3a5be4e08 100644 --- a/web/react/components/post_right.jsx +++ b/web/react/components/post_right.jsx @@ -351,6 +351,7 @@ module.exports = React.createClass({ $(".post-right__scroll").css("height", height + "px"); $(".post-right__scroll").scrollTop(100000); $(".post-right__scroll").perfectScrollbar(); + $(".post-right__scroll").perfectScrollbar('update'); }, render: function() { -- cgit v1.2.3-1-g7c22