Render anonymous users as '?' in top bar

This commit is contained in:
Shane Kilkelly 2017-11-07 14:20:08 +00:00
parent 9180aaff05
commit 484cad2ef0
2 changed files with 8 additions and 2 deletions

View file

@ -71,7 +71,7 @@ header.toolbar.toolbar-header.toolbar-with-labels(
popover-append-to-body="true"
popover-trigger="mouseenter"
ng-click="gotoUser(user)"
) {{ user.name.slice(0,1) }}
) {{ userInitial(user) }}
span.dropdown(dropdown, ng-if="onlineUsersArray.length >= 4")
span.online-user.online-user-multi(

View file

@ -4,4 +4,10 @@ define [
App.controller "OnlineUsersController", ($scope, ide) ->
$scope.gotoUser = (user) ->
if user.doc? and user.row?
ide.editorManager.openDoc(user.doc, gotoLine: user.row + 1)
ide.editorManager.openDoc(user.doc, gotoLine: user.row + 1)
$scope.userInitial = (user) ->
if user.user_id == 'anonymous-user'
'?'
else
user.name.slice(0, 1)