diff --git a/services/web/app/views/project/editor/binary-file.jade b/services/web/app/views/project/editor/binary-file.jade index 4f451f0020..eaaa6e6c65 100644 --- a/services/web/app/views/project/editor/binary-file.jade +++ b/services/web/app/views/project/editor/binary-file.jade @@ -28,7 +28,7 @@ div.binary-file.full-size( div.scroll-container p | {{ bibtexPreview.data }} - p + p(ng-show="bibtexPreview.shouldShowDots") | ... p.no-preview( diff --git a/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee b/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee index 124393d037..ef1fb77389 100644 --- a/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee +++ b/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee @@ -7,6 +7,7 @@ define [ $scope.bibtexPreview = loading: false + shouldShowDots: false error: false data: null @@ -31,11 +32,15 @@ define [ $scope.loadBibtexFilePreview = () -> url = "/project/#{project_id}/file/#{$scope.openFile.id}?range=0-#{TWO_MEGABYTES}" $scope.bibtexPreview.loading = true + $scope.bibtexPreview.shouldShowDots = false $scope.$apply() $http.get(url) .success (data) -> $scope.bibtexPreview.loading = false $scope.bibtexPreview.error = false + # show dots when payload is closs to cutoff + if data.length >= (TWO_MEGABYTES - 200) + $scope.bibtexPreview.shouldShowDots = true try # remove last partial line data = data.replace(/\n.*$/, '')