Added support to swipebox for images listed on the tab-bar files panel.

pull/955/head
George Secrieru 10 years ago
parent 093e8a3058
commit f2fa1c460d
  1. 14
      client/views/app/tabBar/uploadedFilesList.coffee
  2. 4
      client/views/app/tabBar/uploadedFilesList.html

@ -13,7 +13,21 @@ Template.uploadedFilesList.helpers
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()

@ -10,7 +10,7 @@
{{#each files}}
<li>
<i class="{{getFileIcon type}}"></i>
<a title="{{name}}" href="{{url}}" target="_blank">{{name}}</a>
<a title="{{name}}" href="{{url}}" target="_blank" class="room-file-item {{customClassForFileType}}">{{name}}</a>
</li>
{{/each}}
</ul>
@ -22,4 +22,4 @@
{{/if}}
</div>
</div>
</template>
</template>

Loading…
Cancel
Save