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-reject="rejectChange(entry_id);"
on-accept="acceptChange(entry_id);" on-accept="acceptChange(entry_id);"
on-indicator-click="toggleReviewPanel();" on-indicator-click="toggleReviewPanel();"
ng-click="gotoEntry(doc_id, entry)"
) )
div(ng-if="entry.type === 'comment'") div(ng-if="entry.type === 'comment'")
@ -63,6 +64,7 @@
on-resolve="" on-resolve=""
on-reply="submitReply(entry);" on-reply="submitReply(entry);"
on-indicator-click="toggleReviewPanel();" on-indicator-click="toggleReviewPanel();"
ng-click="gotoEntry(doc_id, entry)"
) )
.rp-nav .rp-nav

View file

@ -41,6 +41,11 @@ define [
return if !doc? return if !doc?
@openDoc(doc) @openDoc(doc)
openDocId: (doc_id, options = {}) ->
doc = @ide.fileTreeManager.findEntityById(doc_id)
return if !doc?
@openDoc(doc, options)
openDoc: (doc, options = {}) -> openDoc: (doc, options = {}) ->
sl_console.log "[openDoc] Opening #{doc.id}" sl_console.log "[openDoc] Opening #{doc.id}"
@$scope.ui.view = "editor" @$scope.ui.view = "editor"

View file

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

View file

@ -147,6 +147,10 @@ define [
$scope.setSubView = (subView) -> $scope.setSubView = (subView) ->
$scope.reviewPanel.subView = 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 # 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 # when we get an id we don't know. This'll do for client side testing
refreshUsers = () -> refreshUsers = () ->