mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-10 06:39:01 +02:00
Add event to trigger syncToPdf so can be triggered by key bind
This commit is contained in:
+3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user