mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Preview up to Two Megabytes of bib files
This commit is contained in:
parent
5df5ba868c
commit
3c298ed6ad
1 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,8 @@ define [
|
|||
], (App) ->
|
||||
App.controller "BinaryFileController", ["$scope", "$rootScope", "$http", "$timeout", ($scope, $rootScope, $http, $timeout) ->
|
||||
|
||||
TWO_MEGABYTES = 2 * 1024 * 1024
|
||||
|
||||
$scope.bibtexPreview =
|
||||
loading: false
|
||||
error: false
|
||||
|
@ -20,7 +22,7 @@ define [
|
|||
return file.name.split(".").pop()?.toLowerCase()
|
||||
|
||||
$scope.loadBibtexFilePreview = () ->
|
||||
url = "/project/#{project_id}/file/#{$scope.openFile.id}?range=0-5000"
|
||||
url = "/project/#{project_id}/file/#{$scope.openFile.id}?range=0-#{TWO_MEGABYTES}"
|
||||
$scope.bibtexPreview.loading = true
|
||||
$http.get(url)
|
||||
.success (data) ->
|
||||
|
|
Loading…
Reference in a new issue