The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/views/app/tabBar/uploadedFilesList.coffee

33 lines
780 B

roomFiles = new Mongo.Collection 'room_files'
Template.uploadedFilesList.helpers
files: ->
return roomFiles.find().fetch()
hasFiles: ->
return roomFiles.find().count() > 0
getFileIcon: (type) ->
if type.match(/^image\/.+$/)
return 'icon-picture'
return 'icon-docs'
customClassForFileType: ->
if this.type.match(/^image\/.+$/)
return 'room-files-swipebox'
Template.uploadedFilesList.events
'click .room-file-item': (e, t) ->
if $(e.currentTarget).siblings('.icon-picture').length
e.preventDefault()
Template.uploadedFilesList.onCreated ->
instance = this
this.autorun ->
instance.subscribe 'roomFiles', Session.get('openedRoom')
Template.uploadedFilesList.onRendered ->
$('.room-files-swipebox').swipebox()