Commit 8207d347 authored by Aron Carroll's avatar Aron Carroll

Reorder variable assignment in setupAndLoadAnnotations

parent 732bc59d
...@@ -29,6 +29,7 @@ class AnnotationMapperService ...@@ -29,6 +29,7 @@ class AnnotationMapperService
# From Annotator core. # From Annotator core.
setupAndLoadAnnotations = (annotations) => setupAndLoadAnnotations = (annotations) =>
clone = annotations.slice()
loader = (annList=[]) => loader = (annList=[]) =>
now = annList.splice(0,10) now = annList.splice(0,10)
...@@ -42,13 +43,10 @@ class AnnotationMapperService ...@@ -42,13 +43,10 @@ class AnnotationMapperService
else else
$rootScope.$emit('annotationsLoaded', clone) $rootScope.$emit('annotationsLoaded', clone)
clone = annotations.slice()
if annotations.length # Do we have to do something? if annotations.length # Do we have to do something?
setTimeout -> loader(annotations) setTimeout -> loader(annotations)
else # no pending scan else # no pending scan
# We can start parsing them right away # We can start parsing them right away
loader(annotations) loader(annotations)
this
angular.module('h').service('annotationMapper', AnnotationMapperService) angular.module('h').service('annotationMapper', AnnotationMapperService)
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