mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-22 02:04:31 +00:00
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:
commit
ca31914719
2 changed files with 5 additions and 0 deletions
|
@ -37,6 +37,9 @@ define [], () ->
|
|||
onCursorChange: () =>
|
||||
@emitCursorUpdateEvent()
|
||||
|
||||
onSyncToPdf: () =>
|
||||
@$scope.$emit "cursor:#{@$scope.name}:syncToPdf"
|
||||
|
||||
storeFirstVisibleLine: () ->
|
||||
if @doc_id?
|
||||
docPosition = @localStorage("doc.position.#{@doc_id}") || {}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue