From 796a3001ccf7dd2729ff06f4dfd0e8614ae5de3a Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Fri, 21 Aug 2015 00:54:35 +0500 Subject: MM-1696 - Improvements for Slack Import --- web/react/components/setting_upload.jsx | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'web/react/components/setting_upload.jsx') diff --git a/web/react/components/setting_upload.jsx b/web/react/components/setting_upload.jsx index 870710850..02789f5dd 100644 --- a/web/react/components/setting_upload.jsx +++ b/web/react/components/setting_upload.jsx @@ -46,17 +46,25 @@ module.exports = React.createClass({ serverError: '' }); }, + onFileSelect: function(e) { + var filename = $(e.target).val(); + if (filename.substring(3, 11) === 'fakepath') { + filename = filename.substring(12); + } + $(e.target).closest('li').find('.file-status').addClass('hide'); + $(e.target).closest('li').find('.file-name').removeClass('hide').html(filename); + }, render: function() { var clientError = null; if (this.state.clientError) { clientError = ( -
+
{this.state.clientError}
); } var serverError = null; if (this.state.serverError) { serverError = ( -
+
{this.state.serverError}
); } return ( @@ -65,11 +73,21 @@ module.exports = React.createClass({
  • -- cgit v1.2.3-1-g7c22