open pdf attachments in a new tab
parent
fefb6aca10
commit
389f27880c
|
@ -215,6 +215,9 @@ _.mixin
|
|||
isImage = (name) ->
|
||||
return name.match(/\.(jpe?g|png|gif|gifv|webm)/i) != null
|
||||
|
||||
isPdf = (name) ->
|
||||
return name.match(/\.(pdf)/i) != null
|
||||
|
||||
patch = (oldImmutable, newImmutable) ->
|
||||
pathObj = {}
|
||||
|
||||
|
@ -252,4 +255,5 @@ taiga.stripTags = stripTags
|
|||
taiga.replaceTags = replaceTags
|
||||
taiga.defineImmutableProperty = defineImmutableProperty
|
||||
taiga.isImage = isImage
|
||||
taiga.isPdf = isPdf
|
||||
taiga.patch = patch
|
||||
|
|
|
@ -28,6 +28,9 @@ AttachmentLinkDirective = ($parse, attachmentsPreviewService, lightboxService) -
|
|||
scope.$apply ->
|
||||
lightboxService.open($('tg-attachments-preview'))
|
||||
attachmentsPreviewService.fileId = attachment.getIn(['file', 'id'])
|
||||
else if taiga.isPdf(attachment.getIn(['file', 'name']))
|
||||
event.preventDefault()
|
||||
window.open(attachment.getIn(['file', 'url']))
|
||||
|
||||
scope.$on "$destroy", -> el.off()
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue