15
15
< div class ="header low ">
16
16
< h1 > Code coverage report for < span class ="entity "> src/ng-reading-indicator.js</ span > </ h1 >
17
17
< h2 >
18
- Statements: < span class ="metric "> 35.11 % < small > (33 / 94 )</ small > </ span >
19
- Branches: < span class ="metric "> 25.29 % < small > (22 / 87 )</ small > </ span >
18
+ Statements: < span class ="metric "> 35.71 % < small > (35 / 98 )</ small > </ span >
19
+ Branches: < span class ="metric "> 28.26 % < small > (26 / 92 )</ small > </ span >
20
20
Functions: < span class ="metric "> 50% < small > (8 / 16)</ small > </ span >
21
- Lines: < span class ="metric "> 35.11 % < small > (33 / 94 )</ small > </ span >
21
+ Lines: < span class ="metric "> 35.71 % < small > (35 / 98 )</ small > </ span >
22
22
Ignored: < span class ="metric "> < span class ="ignore-none "> none</ span > </ span >
23
23
</ h2 >
24
24
< div class ="path "> < a href ="../index.html "> All files</ a > » < a href ="index.html "> src/</ a > » ng-reading-indicator.js</ div >
@@ -229,7 +229,13 @@ <h2>
229
229
202
230
230
203
231
231
204
232
- 205</ td > < td class ="line-coverage "> < span class ="cline-any cline-yes "> 1</ span >
232
+ 205
233
+ 206
234
+ 207
235
+ 208
236
+ 209
237
+ 210
238
+ 211</ td > < td class ="line-coverage "> < span class ="cline-any cline-yes "> 1</ span >
233
239
< span class ="cline-any cline-neutral "> </ span >
234
240
< span class ="cline-any cline-neutral "> </ span >
235
241
< span class ="cline-any cline-yes "> 1</ span >
282
288
< span class ="cline-any cline-neutral "> </ span >
283
289
< span class ="cline-any cline-neutral "> </ span >
284
290
< span class ="cline-any cline-neutral "> </ span >
291
+ < span class ="cline-any cline-neutral "> </ span >
285
292
< span class ="cline-any cline-yes "> 1</ span >
286
293
< span class ="cline-any cline-yes "> 4</ span >
287
294
< span class ="cline-any cline-yes "> 8</ span >
@@ -301,6 +308,10 @@ <h2>
301
308
< span class ="cline-any cline-yes "> 4</ span >
302
309
< span class ="cline-any cline-neutral "> </ span >
303
310
< span class ="cline-any cline-yes "> 4</ span >
311
+ < span class ="cline-any cline-yes "> 4</ span >
312
+ < span class ="cline-any cline-neutral "> </ span >
313
+ < span class ="cline-any cline-neutral "> </ span >
314
+ < span class ="cline-any cline-yes "> 4</ span >
304
315
< span class ="cline-any cline-yes "> 1</ span >
305
316
< span class ="cline-any cline-yes "> 3</ span >
306
317
< span class ="cline-any cline-yes "> 1</ span >
@@ -355,23 +366,24 @@ <h2>
355
366
< span class ="cline-any cline-neutral "> </ span >
356
367
< span class ="cline-any cline-yes "> 1</ span >
357
368
< span class ="cline-any cline-no "> </ span >
369
+ < span class ="cline-any cline-no "> </ span >
358
370
< span class ="cline-any cline-neutral "> </ span >
359
371
< span class ="cline-any cline-no "> </ span >
360
372
< span class ="cline-any cline-no "> </ span >
361
- < span class ="cline-any cline-neutral "> </ span >
373
+ < span class ="cline-any cline-no "> </ span >
362
374
< span class ="cline-any cline-no "> </ span >
363
375
< span class ="cline-any cline-neutral "> </ span >
364
376
< span class ="cline-any cline-neutral "> </ span >
365
377
< span class ="cline-any cline-no "> </ span >
378
+ < span class ="cline-any cline-neutral "> </ span >
366
379
< span class ="cline-any cline-no "> </ span >
367
380
< span class ="cline-any cline-no "> </ span >
368
- < span class ="cline-any cline-neutral "> </ span >
369
- < span class ="cline-any cline-neutral "> </ span >
370
381
< span class ="cline-any cline-no "> </ span >
371
382
< span class ="cline-any cline-neutral "> </ span >
372
383
< span class ="cline-any cline-neutral "> </ span >
373
384
< span class ="cline-any cline-no "> </ span >
374
385
< span class ="cline-any cline-neutral "> </ span >
386
+ < span class ="cline-any cline-neutral "> </ span >
375
387
< span class ="cline-any cline-no "> </ span >
376
388
< span class ="cline-any cline-neutral "> </ span >
377
389
< span class ="cline-any cline-no "> </ span >
471
483
expandOffset = null,
472
484
expandOnHeadline = false,
473
485
options = {
486
+ calcFrom: 'middle',
474
487
showHeadline: true,
475
488
expand: true,
476
489
type: 'small',
@@ -503,6 +516,10 @@ <h2>
503
516
}
504
517
505
518
extendDeep(options, scope.userOptions());
519
+
520
+ < span class ="missing-if-branch " title ="else path not taken " > E</ span > if (options.calcFrom !== 'bottom' && options.calcFrom !== 'top' && options.calcFrom !== 'bottom') {
521
+ options.calcFrom = 'middle';
522
+ }
506
523
507
524
if (!options.expand && options.type !== 'small') {
508
525
angular.element(element).addClass('ng-reading-indicator-expanded');
@@ -559,13 +576,16 @@ <h2>
559
576
560
577
< span class ="fstat-no " title ="function not covered " > function updateProgress() {</ span >
561
578
< span class ="cstat-no " title ="statement not covered " > var scrollPos = angular.element($window)[0].scrollY || angular.element($window)[0].pageYOffset;</ span >
579
+ < span class ="cstat-no " title ="statement not covered " > var origScrollPos = scrollPos;</ span >
562
580
563
- < span class ="cstat-no " title ="statement not covered " > if (article[0].scrollHeight - window.innerHeight > 0 ) {</ span >
564
- < span class ="cstat-no " title ="statement not covered " > progress = ( scrollPos <= top) ? 0 : ((scrollPos-top) / bottom) * 100 ;</ span >
565
- } else {
566
- < span class ="cstat-no " title ="statement not covered " > progress = ( scrollPos <= top) ? 0 : (((scrollPos-top)+((top + bottom) - (document.body.offsetHeight - window.innerHeight))) / bottom) * 100 ;</ span >
581
+ < span class ="cstat-no " title ="statement not covered " > if (options.calcFrom === 'middle' ) {</ span >
582
+ < span class ="cstat-no " title ="statement not covered " > scrollPos = origScrollPos + (window.innerHeight / 2) ;</ span >
583
+ } else < span class =" cstat-no " title =" statement not covered " > if (options.calcFrom === 'bottom') { </ span >
584
+ < span class ="cstat-no " title ="statement not covered " > scrollPos = origScrollPos + window.innerHeight;</ span >
567
585
}
568
586
587
+ < span class ="cstat-no " title ="statement not covered " > progress = (scrollPos <= top) ? 0 : ((scrollPos-top) / (top-bottom)) * 100;</ span >
588
+
569
589
< span class ="cstat-no " title ="statement not covered " > if (options.readingTime.enable) {</ span >
570
590
< span class ="cstat-no " title ="statement not covered " > scope.$apply( < span class ="fstat-no " title ="function not covered " > function(){</ span > </ span >
571
591
< span class ="cstat-no " title ="statement not covered " > scope.readingTime = calculateReadingTime();</ span >
576
596
577
597
< span class ="cstat-no " title ="statement not covered " > progressBar.style.width = progress + '%';</ span >
578
598
579
- < span class ="cstat-no " title ="statement not covered " > console.log(options, expandOffset.top, options.topOffset);</ span >
580
-
581
599
< span class ="cstat-no " title ="statement not covered " > if ((!options.expand && options.type === 'small' && scrollPos >= (top + expandOffset.top + options.topOffset)) || (options.expand && scrollPos > top && scrollPos < (top + expandOffset.top + options.topOffset))) {</ span >
582
600
< span class ="cstat-no " title ="statement not covered " > angular.element(element)[0].style.height = '5px';</ span >
583
601
< span class ="cstat-no " title ="statement not covered " > angular.element(element).addClass('ng-reading-indicator-shrink');</ span >
642
660
643
661
</ div >
644
662
< div class ="footer ">
645
- < div class ="meta "> Generated by < a href ="http://istanbul-js.org/ " target ="_blank "> istanbul</ a > at Thu Jul 16 2015 10:01:41 GMT+0200 (CEST)</ div >
663
+ < div class ="meta "> Generated by < a href ="http://istanbul-js.org/ " target ="_blank "> istanbul</ a > at Thu Jul 16 2015 11:55:11 GMT+0200 (CEST)</ div >
646
664
</ div >
647
665
< script src ="../prettify.js "> </ script >
648
666
< script >
0 commit comments