mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Don't render URL section if not linked file
This commit is contained in:
parent
fac1f0d3ac
commit
e77168d791
2 changed files with 4 additions and 2 deletions
|
@ -38,7 +38,7 @@ div.binary-file.full-size(
|
||||||
) #{translate("no_preview_available")} {{ failedLoad }} {{ textPreview.error }} {{ isUnpreviewableFile() }}
|
) #{translate("no_preview_available")} {{ failedLoad }} {{ textPreview.error }} {{ isUnpreviewableFile() }}
|
||||||
|
|
||||||
div.binary-file-footer
|
div.binary-file-footer
|
||||||
div(ng-show="openFile.linkedFileData.provider == 'url'")
|
div(ng-if="openFile.linkedFileData.provider == 'url'")
|
||||||
p
|
p
|
||||||
i.fa.fa-fw.fa-external-link-square.fa-rotate-180.linked-file-icon
|
i.fa.fa-fw.fa-external-link-square.fa-rotate-180.linked-file-icon
|
||||||
| Imported from
|
| Imported from
|
||||||
|
@ -47,7 +47,7 @@ div.binary-file.full-size(
|
||||||
|
|
|
|
||||||
| at {{ openFile.created | formatDate:'h:mm a' }} {{ openFile.created | relativeDate }}
|
| 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(
|
button.btn.btn-success(
|
||||||
href, ng-click="refreshFile(openFile)",
|
href, ng-click="refreshFile(openFile)",
|
||||||
ng-disabled="refreshing"
|
ng-disabled="refreshing"
|
||||||
|
|
|
@ -37,6 +37,8 @@ define [
|
||||||
FILLER = '...'
|
FILLER = '...'
|
||||||
TAIL_OF_URL_LENGTH = MAX_URL_LENGTH - FRONT_OF_URL_LENGTH - FILLER.length
|
TAIL_OF_URL_LENGTH = MAX_URL_LENGTH - FRONT_OF_URL_LENGTH - FILLER.length
|
||||||
$scope.displayUrl = (url) ->
|
$scope.displayUrl = (url) ->
|
||||||
|
if !url?
|
||||||
|
return
|
||||||
if url.length > MAX_URL_LENGTH
|
if url.length > MAX_URL_LENGTH
|
||||||
front = url.slice(0, FRONT_OF_URL_LENGTH)
|
front = url.slice(0, FRONT_OF_URL_LENGTH)
|
||||||
tail = url.slice(url.length - TAIL_OF_URL_LENGTH)
|
tail = url.slice(url.length - TAIL_OF_URL_LENGTH)
|
||||||
|
|
Loading…
Reference in a new issue