mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
clear the pdf renderqueue faster after the initial page has rendered
This commit is contained in:
parent
7ea20c4266
commit
4c0f3c55d7
1 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,7 @@ define [
|
||||||
App.factory 'PDFRenderer', ['$q', '$timeout', 'pdfAnnotations', 'pdfTextLayer', ($q, $timeout, pdfAnnotations, pdfTextLayer) ->
|
App.factory 'PDFRenderer', ['$q', '$timeout', 'pdfAnnotations', 'pdfTextLayer', ($q, $timeout, pdfAnnotations, pdfTextLayer) ->
|
||||||
|
|
||||||
class PDFRenderer
|
class PDFRenderer
|
||||||
@JOB_QUEUE_INTERVAL: 100
|
JOB_QUEUE_INTERVAL: 25
|
||||||
|
|
||||||
constructor: (@url, @options) ->
|
constructor: (@url, @options) ->
|
||||||
PDFJS.disableAutoFetch = true
|
PDFJS.disableAutoFetch = true
|
||||||
|
@ -61,16 +61,16 @@ define [
|
||||||
q.pagenum != pagenum
|
q.pagenum != pagenum
|
||||||
# @stopSpinner (element.canvas)
|
# @stopSpinner (element.canvas)
|
||||||
|
|
||||||
triggerRenderQueue: () ->
|
triggerRenderQueue: (interval = @JOB_QUEUE_INTERVAL) ->
|
||||||
$timeout () =>
|
$timeout () =>
|
||||||
@processRenderQueue()
|
@processRenderQueue()
|
||||||
, @JOB_QUEUE_INTERVAL
|
, interval
|
||||||
|
|
||||||
removeCompletedJob: (pagenum) ->
|
removeCompletedJob: (pagenum) ->
|
||||||
# may need to clean up deferred object here
|
# may need to clean up deferred object here
|
||||||
delete @renderTask[pagenum]
|
delete @renderTask[pagenum]
|
||||||
@jobs = @jobs - 1
|
@jobs = @jobs - 1
|
||||||
@triggerRenderQueue()
|
@triggerRenderQueue(0)
|
||||||
|
|
||||||
renderPage: (element, pagenum) ->
|
renderPage: (element, pagenum) ->
|
||||||
viewport = $q.defer()
|
viewport = $q.defer()
|
||||||
|
|
Loading…
Reference in a new issue