Goto a change when clicked in the overview panel

This commit is contained in:
James Allen 2016-11-17 15:55:18 +00:00
parent dcb4bd0dc8
commit 4a93e02407
4 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -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"

View file

@ -305,6 +305,7 @@ define [
y = screen_position.row * renderer.lineHeight
entry.screenPos ?= {}
entry.screenPos.y = y
entry.docPos = doc_position
@$scope.$apply()

View file

@ -146,7 +146,11 @@ 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 = () ->