mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 22:59:01 +02:00
Merge pull request #381 from sharelatex/ja-fix-undefined-url
Don't render URL section if not linked file
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user