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
1940415e
Commit
1940415e
authored
Apr 18, 2019
by
Hannah Stepanek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make isloading an attr on 'this' when defining
parent
a564e2a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
sidebar-content.js
src/sidebar/components/sidebar-content.js
+9
-7
No files found.
src/sidebar/components/sidebar-content.js
View file @
1940415e
...
...
@@ -161,7 +161,7 @@ function SidebarContentController(
searchClient
.
get
({
uri
:
uris
,
group
:
group
});
}
function
isLoading
()
{
this
.
isLoading
=
function
()
{
if
(
!
store
.
frames
().
some
(
function
(
frame
)
{
return
frame
.
uri
;
...
...
@@ -177,7 +177,7 @@ function SidebarContentController(
}
return
false
;
}
}
;
/**
* Load annotations for all URLs associated with `frames`.
...
...
@@ -272,7 +272,7 @@ function SidebarContentController(
// of switching to the group containing a direct-linked annotation.
//
// In that case, we don't want to trigger reloading annotations again.
if
(
isLoading
())
{
if
(
this
.
isLoading
())
{
return
;
}
store
.
clearSelectedAnnotations
();
...
...
@@ -307,7 +307,9 @@ function SidebarContentController(
this
.
selectedAnnotationUnavailable
=
function
()
{
const
selectedID
=
firstKey
(
store
.
getState
().
selectedAnnotationMap
);
return
!
isLoading
()
&&
!!
selectedID
&&
!
store
.
annotationExists
(
selectedID
);
return
(
!
this
.
isLoading
()
&&
!!
selectedID
&&
!
store
.
annotationExists
(
selectedID
)
);
};
this
.
shouldShowLoggedOutMessage
=
function
()
{
...
...
@@ -332,11 +334,11 @@ function SidebarContentController(
// annotation. If there is an annotation selection and that
// selection is available to the user, show the CTA.
const
selectedID
=
firstKey
(
store
.
getState
().
selectedAnnotationMap
);
return
!
isLoading
()
&&
!!
selectedID
&&
store
.
annotationExists
(
selectedID
);
return
(
!
this
.
isLoading
()
&&
!!
selectedID
&&
store
.
annotationExists
(
selectedID
)
);
};
this
.
isLoading
=
isLoading
;
const
visibleCount
=
memoize
(
function
(
thread
)
{
return
thread
.
children
.
reduce
(
function
(
count
,
child
)
{
...
...
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