Merge pull request #754 from sharelatex/as-fix-missing-key-binds

Add event to trigger syncToPdf so can be triggered by key bind
This commit is contained in:
Alasdair Smith 2018-07-13 11:17:17 +01:00 committed by GitHub
commit ca31914719
2 changed files with 5 additions and 0 deletions

View file

@ -37,6 +37,9 @@ define [], () ->
onCursorChange: () =>
@emitCursorUpdateEvent()
onSyncToPdf: () =>
@$scope.$emit "cursor:#{@$scope.name}:syncToPdf"
storeFirstVisibleLine: () ->
if @doc_id?
docPosition = @localStorage("doc.position.#{@doc_id}") || {}

View file

@ -718,6 +718,8 @@ define [
.then (highlights) ->
$scope.pdf.highlights = highlights
ide.$scope.$on "cursor:editor:syncToPdf", $scope.syncToPdf
$scope.syncToCode = () ->
synctex
.syncToCode($scope.pdf.position, includeVisualOffset: true, fromPdfPosition: true)