Don't render URL section if not linked file

This commit is contained in:
James Allen 2018-03-05 11:21:31 +00:00
parent fac1f0d3ac
commit e77168d791
2 changed files with 4 additions and 2 deletions

View file

@ -38,7 +38,7 @@ div.binary-file.full-size(
) #{translate("no_preview_available")} {{ failedLoad }} {{ textPreview.error }} {{ isUnpreviewableFile() }}
div.binary-file-footer
div(ng-show="openFile.linkedFileData.provider == 'url'")
div(ng-if="openFile.linkedFileData.provider == 'url'")
p
i.fa.fa-fw.fa-external-link-square.fa-rotate-180.linked-file-icon
| Imported from
@ -47,7 +47,7 @@ div.binary-file.full-size(
|
| at {{ openFile.created | formatDate:'h:mm a' }} {{ openFile.created | relativeDate }}
span(ng-show="openFile.linkedFileData.provider == 'url'")
span(ng-if="openFile.linkedFileData.provider == 'url'")
button.btn.btn-success(
href, ng-click="refreshFile(openFile)",
ng-disabled="refreshing"

View file

@ -37,6 +37,8 @@ define [
FILLER = '...'
TAIL_OF_URL_LENGTH = MAX_URL_LENGTH - FRONT_OF_URL_LENGTH - FILLER.length
$scope.displayUrl = (url) ->
if !url?
return
if url.length > MAX_URL_LENGTH
front = url.slice(0, FRONT_OF_URL_LENGTH)
tail = url.slice(url.length - TAIL_OF_URL_LENGTH)