diff --git a/services/web/public/coffee/ide/pdfng/directives/pdfPage.coffee b/services/web/public/coffee/ide/pdfng/directives/pdfPage.coffee index b929ede5c9..d52ef60256 100644 --- a/services/web/public/coffee/ide/pdfng/directives/pdfPage.coffee +++ b/services/web/public/coffee/ide/pdfng/directives/pdfPage.coffee @@ -55,7 +55,8 @@ define [ if scope.page.current # console.log 'we must scroll to this page', scope.page.pageNum, 'at position', scope.page.position # this is the current page, we want to scroll it into view - # FIXME: do we need to ensure render fires before moving to this position??? + # and render it immediately + scope.document.renderPage scope.page ctrl.setPdfPosition(scope.page, scope.page.position) element.on 'dblclick', (e) -> diff --git a/services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee b/services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee index 46803fcc06..31880b83ca 100644 --- a/services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee +++ b/services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee @@ -110,6 +110,15 @@ define [ } @triggerRenderQueue() + renderPage: (page) -> + return if @shuttingDown + current = { + 'element': page.elementChildren + 'pagenum': page.pageNum + } + @renderQueue.push current + @processRenderQueue() + processRenderQueue: () -> return if @shuttingDown return if @jobs > 0