Commit 1940415e authored by Hannah Stepanek's avatar Hannah Stepanek

Make isloading an attr on 'this' when defining

parent a564e2a9
...@@ -161,7 +161,7 @@ function SidebarContentController( ...@@ -161,7 +161,7 @@ function SidebarContentController(
searchClient.get({ uri: uris, group: group }); searchClient.get({ uri: uris, group: group });
} }
function isLoading() { this.isLoading = function() {
if ( if (
!store.frames().some(function(frame) { !store.frames().some(function(frame) {
return frame.uri; return frame.uri;
...@@ -177,7 +177,7 @@ function SidebarContentController( ...@@ -177,7 +177,7 @@ function SidebarContentController(
} }
return false; return false;
} };
/** /**
* Load annotations for all URLs associated with `frames`. * Load annotations for all URLs associated with `frames`.
...@@ -272,7 +272,7 @@ function SidebarContentController( ...@@ -272,7 +272,7 @@ function SidebarContentController(
// of switching to the group containing a direct-linked annotation. // of switching to the group containing a direct-linked annotation.
// //
// In that case, we don't want to trigger reloading annotations again. // In that case, we don't want to trigger reloading annotations again.
if (isLoading()) { if (this.isLoading()) {
return; return;
} }
store.clearSelectedAnnotations(); store.clearSelectedAnnotations();
...@@ -307,7 +307,9 @@ function SidebarContentController( ...@@ -307,7 +307,9 @@ function SidebarContentController(
this.selectedAnnotationUnavailable = function() { this.selectedAnnotationUnavailable = function() {
const selectedID = firstKey(store.getState().selectedAnnotationMap); const selectedID = firstKey(store.getState().selectedAnnotationMap);
return !isLoading() && !!selectedID && !store.annotationExists(selectedID); return (
!this.isLoading() && !!selectedID && !store.annotationExists(selectedID)
);
}; };
this.shouldShowLoggedOutMessage = function() { this.shouldShowLoggedOutMessage = function() {
...@@ -332,11 +334,11 @@ function SidebarContentController( ...@@ -332,11 +334,11 @@ function SidebarContentController(
// annotation. If there is an annotation selection and that // annotation. If there is an annotation selection and that
// selection is available to the user, show the CTA. // selection is available to the user, show the CTA.
const selectedID = firstKey(store.getState().selectedAnnotationMap); 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) { const visibleCount = memoize(function(thread) {
return thread.children.reduce( return thread.children.reduce(
function(count, child) { function(count, child) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment