Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
389113ad
Commit
389113ad
authored
Sep 30, 2015
by
Sean Hammond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Focus the public group on logout
parent
4aa56fdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
app-controller.coffee
h/static/scripts/app-controller.coffee
+12
-3
app-controller-test.coffee
h/static/scripts/test/app-controller-test.coffee
+4
-0
No files found.
h/static/scripts/app-controller.coffee
View file @
389113ad
...
...
@@ -4,11 +4,13 @@ angular = require('angular')
module
.
exports
=
class
AppController
this
.
$inject
=
[
'$controller'
,
'$document'
,
'$location'
,
'$route'
,
'$scope'
,
'$window'
,
'annotationUI'
,
'auth'
,
'drafts'
,
'features'
,
'identity'
,
'session'
'annotationUI'
,
'auth'
,
'drafts'
,
'features'
,
'groups'
,
'identity'
,
'session'
]
constructor
:
(
$controller
,
$document
,
$location
,
$route
,
$scope
,
$window
,
annotationUI
,
auth
,
drafts
,
features
,
identity
,
session
annotationUI
,
auth
,
drafts
,
features
,
groups
,
identity
,
session
)
->
$controller
(
'AnnotationUIController'
,
{
$scope
})
...
...
@@ -42,7 +44,14 @@ module.exports = class AppController
identity
.
watch
({
onlogin
:
(
identity
)
->
$scope
.
auth
.
user
=
auth
.
userid
(
identity
)
onlogout
:
->
$scope
.
auth
.
user
=
null
onlogout
:
->
$scope
.
auth
.
user
=
null
# Currently all groups are private so when the user logs out they can
# no longer see the annotations from any group they may have had
# focused. Focus the public group instead, so that they see any public
# annotations in the sidebar.
groups
.
focus
(
'__world__'
)
onready
:
->
$scope
.
auth
.
user
?=
null
})
...
...
h/static/scripts/test/app-controller-test.coffee
View file @
389113ad
...
...
@@ -11,6 +11,7 @@ describe 'AppController', ->
fakeLocation
=
null
fakeParams
=
null
fakeSession
=
null
fakeGroups
=
null
sandbox
=
null
...
...
@@ -62,12 +63,15 @@ describe 'AppController', ->
fakeSession
=
{}
fakeGroups
=
{
focus
:
->
}
$provide
.
value
'annotationUI'
,
fakeAnnotationUI
$provide
.
value
'auth'
,
fakeAuth
$provide
.
value
'drafts'
,
fakeDrafts
$provide
.
value
'features'
,
fakeFeatures
$provide
.
value
'identity'
,
fakeIdentity
$provide
.
value
'session'
,
fakeSession
$provide
.
value
'groups'
,
fakeGroups
$provide
.
value
'$location'
,
fakeLocation
$provide
.
value
'$routeParams'
,
fakeParams
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment