summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-28 16:41:57 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-29 10:04:28 -0400
commitaf246bb44b7968b9f880d819e3aa04342846fccc (patch)
treea7fc74d5bffa684aee1a9d445c47b9f9d25835e7 /web/react/utils
parentb0c64c73f929c9021196706fa1352ac4aa6f95a4 (diff)
downloadchat-af246bb44b7968b9f880d819e3aa04342846fccc.tar.gz
chat-af246bb44b7968b9f880d819e3aa04342846fccc.tar.bz2
chat-af246bb44b7968b9f880d819e3aa04342846fccc.zip
Updated ViewImage modal dialog to include details about non-image files
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/utils.jsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index d1513dea9..09240bf06 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -907,3 +907,9 @@ module.exports.getFileUrl = function(filename) {
return url;
};
+
+// Gets the name of a file (including extension) from a given url or file path.
+module.exports.getFileName = function(path) {
+ var split = path.split('/');
+ return split[split.length - 1];
+};