mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Goto a change when clicked in the overview panel
This commit is contained in:
parent
dcb4bd0dc8
commit
4a93e02407
4 changed files with 13 additions and 1 deletions
|
@ -54,6 +54,7 @@
|
|||
on-reject="rejectChange(entry_id);"
|
||||
on-accept="acceptChange(entry_id);"
|
||||
on-indicator-click="toggleReviewPanel();"
|
||||
ng-click="gotoEntry(doc_id, entry)"
|
||||
)
|
||||
|
||||
div(ng-if="entry.type === 'comment'")
|
||||
|
@ -63,6 +64,7 @@
|
|||
on-resolve=""
|
||||
on-reply="submitReply(entry);"
|
||||
on-indicator-click="toggleReviewPanel();"
|
||||
ng-click="gotoEntry(doc_id, entry)"
|
||||
)
|
||||
|
||||
.rp-nav
|
||||
|
|
|
@ -41,6 +41,11 @@ define [
|
|||
return if !doc?
|
||||
@openDoc(doc)
|
||||
|
||||
openDocId: (doc_id, options = {}) ->
|
||||
doc = @ide.fileTreeManager.findEntityById(doc_id)
|
||||
return if !doc?
|
||||
@openDoc(doc, options)
|
||||
|
||||
openDoc: (doc, options = {}) ->
|
||||
sl_console.log "[openDoc] Opening #{doc.id}"
|
||||
@$scope.ui.view = "editor"
|
||||
|
|
|
@ -305,6 +305,7 @@ define [
|
|||
y = screen_position.row * renderer.lineHeight
|
||||
entry.screenPos ?= {}
|
||||
entry.screenPos.y = y
|
||||
entry.docPos = doc_position
|
||||
|
||||
@$scope.$apply()
|
||||
|
||||
|
|
|
@ -147,6 +147,10 @@ define [
|
|||
$scope.setSubView = (subView) ->
|
||||
$scope.reviewPanel.subView = subView
|
||||
|
||||
$scope.gotoEntry = (doc_id, entry) ->
|
||||
console.log "Going to entry", entry.docPos
|
||||
ide.editorManager.openDocId(doc_id, { gotoLine: entry.docPos.row + 1, gotoColumn: entry.docPos.column })
|
||||
|
||||
# TODO: Eventually we need to get this from the server, and update it
|
||||
# when we get an id we don't know. This'll do for client side testing
|
||||
refreshUsers = () ->
|
||||
|
|
Loading…
Reference in a new issue