Show file names in overview panel

This commit is contained in:
James Allen 2016-11-17 16:05:12 +00:00
parent 4a93e02407
commit 7a8af8a21a
2 changed files with 10 additions and 1 deletions

View file

@ -43,7 +43,7 @@
ng-repeat="(doc_id, entries) in reviewPanel.entries"
)
.rp-overview-file-header
| {{ doc_id }}
| {{ getFileName(doc_id) }}
.rp-entry-wrapper(
ng-repeat="(entry_id, entry) in entries"
)

View file

@ -151,6 +151,15 @@ define [
console.log "Going to entry", entry.docPos
ide.editorManager.openDocId(doc_id, { gotoLine: entry.docPos.row + 1, gotoColumn: entry.docPos.column })
DOC_ID_NAMES = {}
$scope.getFileName = (doc_id) ->
# This is called a lot and is relatively expensive, so cache the result
if !DOC_ID_NAMES[doc_id]?
entity = ide.fileTreeManager.findEntityById(doc_id)
return if !entity?
DOC_ID_NAMES[doc_id] = ide.fileTreeManager.getEntityPath(entity)
return DOC_ID_NAMES[doc_id]
# 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 = () ->