diff --git a/app/js/directives.js b/app/js/directives.js index 52f77f7a..c3fe0781 100755 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -390,6 +390,20 @@ angular.module('myApp.directives', ['myApp.filters']) $scope.videoOpen = function () { AppDocsManager.openVideo($scope.media.document.id, $scope.messageId) } + if ($scope.media.document.file_name) { + var fileNameParts = $scope.media.document.file_name.split('.') + if (fileNameParts.length > 1) { + $scope.media_file_ext = '.' + fileNameParts.pop() + $scope.media_file_name_without_ext = fileNameParts.join('.') + if (!$scope.media_file_name_without_ext) { + $scope.media_file_name_without_ext = $scope.media_file_ext + $scope.media_file_ext = '' + } + } else { + $scope.media_file_ext = '' + $scope.media_file_name_without_ext = fileNameParts[0] + } + } } } }) @@ -482,7 +496,25 @@ angular.module('myApp.directives', ['myApp.filters']) scope: { 'media': '=myMessagePending' }, - templateUrl: templateUrl('message_attach_pending') + templateUrl: templateUrl('message_attach_pending'), + link: link + } + + function link ($scope, element, attrs) { + if ($scope.media.file_name) { + var fileNameParts = $scope.media.file_name.split('.') + if (fileNameParts.length > 1) { + $scope.media_file_ext = '.' + fileNameParts.pop() + $scope.media_file_name_without_ext = fileNameParts.join('.') + if (!$scope.media_file_name_without_ext) { + $scope.media_file_name_without_ext = $scope.media_file_ext + $scope.media_file_ext = '' + } + } else { + $scope.media_file_ext = '' + $scope.media_file_name_without_ext = fileNameParts[0] + } + } } }) diff --git a/app/less/app.less b/app/less/app.less index 8d8d4fd6..81873052 100644 --- a/app/less/app.less +++ b/app/less/app.less @@ -1872,6 +1872,20 @@ img.im_message_document_thumb { vertical-align: text-top; white-space: nowrap; text-overflow: ellipsis; + + &:after { + content: attr(data-name); + display: block; + overflow: hidden; + text-overflow: ellipsis; + } + &:before { + content: attr(data-ext); + float: right; + } + &:hover:before { + text-decoration: underline; + } } .im_message_document_size { color: #999; diff --git a/app/partials/desktop/message_attach_document.html b/app/partials/desktop/message_attach_document.html index 665c5bb5..8ca3d8cc 100755 --- a/app/partials/desktop/message_attach_document.html +++ b/app/partials/desktop/message_attach_document.html @@ -64,7 +64,7 @@
- [] + []
diff --git a/app/partials/desktop/message_attach_pending.html b/app/partials/desktop/message_attach_pending.html index 065908be..ffe7339d 100755 --- a/app/partials/desktop/message_attach_pending.html +++ b/app/partials/desktop/message_attach_pending.html @@ -4,7 +4,7 @@
- +
diff --git a/app/partials/mobile/message_attach_document.html b/app/partials/mobile/message_attach_document.html index dd117092..0ee3d84a 100644 --- a/app/partials/mobile/message_attach_document.html +++ b/app/partials/mobile/message_attach_document.html @@ -41,7 +41,7 @@
- +
diff --git a/app/partials/mobile/message_attach_pending.html b/app/partials/mobile/message_attach_pending.html index 361625ed..078ed71e 100644 --- a/app/partials/mobile/message_attach_pending.html +++ b/app/partials/mobile/message_attach_pending.html @@ -4,7 +4,7 @@
- +