You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,13 @@ The data source object implements methods and properties to be used by the direc
108
108
**Important:** Make sure to respect the `index` and `count` parameters of the request. The array passed to the success method should have
109
109
exactly `count` elements unless it hit eof/bof
110
110
111
+
* Properties `minIndex` and `maxIndex`
112
+
113
+
#### Description
114
+
As the scroller recieves the items requested by the `get` method, the value of minimum and maximum values of the item index are placed in the `minIndex` and `maxIndex` properties respectively. The values of the properties are cumulative - the value of the `minIndex` will never increase, and the value of the `maIndex` will never decrease - except the values are reset in response to a call to the adapter `reload` method. The values of the properties are used to maintain the appearance of the scroller scrollBar.
115
+
116
+
Values of the properties can be assigned programmatically. If the range of the index values is known in advance, assigneing them programmatically would improve the usability of the scrollBar.
117
+
111
118
###Adapter
112
119
The adapter object is an internal object created for every instance of the scroller. Properties and methods of the adapter can be used to manipulate and assess the scroller the adapter was created for. Adapter based API replaces old (undocumented) event based API introduced earlier for this purpose. The event based API is now deprecated and no longer supported.
Copy file name to clipboardExpand all lines: test/BasicTestsSpec.js
+12-21Lines changed: 12 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -265,7 +265,6 @@ describe('uiScroll', function () {
265
265
266
266
viewport.scrollTop(400);
267
267
viewport.trigger('scroll');
268
-
flush();
269
268
270
269
viewport.scrollTop(0);
271
270
viewport.trigger('scroll');
@@ -302,7 +301,6 @@ describe('uiScroll', function () {
302
301
303
302
viewport.scrollTop(400);
304
303
viewport.trigger('scroll');
305
-
flush();
306
304
307
305
viewport.scrollTop(0);
308
306
viewport.trigger('scroll');
@@ -397,11 +395,10 @@ describe('uiScroll', function () {
397
395
varflush=$timeout.flush;
398
396
viewport.scrollTop(viewportHeight+itemHeight);
399
397
viewport.trigger('scroll');
400
-
flush();
398
+
401
399
viewport.scrollTop(viewportHeight+itemHeight*2);
402
400
viewport.trigger('scroll');
403
401
flush();
404
-
expect(flush).toThrow();
405
402
406
403
expect(spy.calls.all().length).toBe(4);
407
404
@@ -434,19 +431,15 @@ describe('uiScroll', function () {
434
431
435
432
viewport.scrollTop(0);//first full, scroll to -2
436
433
viewport.trigger('scroll');
437
-
flush();
438
434
439
435
viewport.scrollTop(0);//last full, scroll to -5, bof is reached
440
436
viewport.trigger('scroll');
441
437
flush();
442
438
443
-
expect(flush).toThrow();
444
439
viewport.scrollTop(0);//empty, no scroll occurred (-8)
445
440
viewport.trigger('scroll');
446
441
flush();
447
442
448
-
expect(flush).toThrow();
449
-
450
443
expect(spy.calls.all().length).toBe(5);
451
444
expect(spy.calls.all()[0].args[0]).toBe(1);
452
445
expect(spy.calls.all()[1].args[0]).toBe(4);
@@ -500,15 +493,15 @@ describe('uiScroll', function () {
500
493
wheelEventElement.dispatchEvent(getNewWheelEvent());//now we are at the top but preventDefault is occurred because of bof will be reached only after next scroll trigger
501
494
expect(documentScrollBubblingCount).toBe(2);//here! the only one prevented wheel-event
502
495
503
-
flush();
496
+
//flush();
504
497
505
498
wheelEventElement.dispatchEvent(getNewWheelEvent());//preventDefault will not occurred but document will not scroll because of viewport will be scrolled
506
499
expect(documentScrollBubblingCount).toBe(3);
507
500
508
501
viewport.scrollTop(0);
509
502
viewport.trigger('scroll');//bof will be reached right after that
510
503
511
-
flush();
504
+
//flush();
512
505
513
506
wheelEventElement.dispatchEvent(getNewWheelEvent());//preventDefault will not occurred because of we are at the top and bof is reached
514
507
expect(documentScrollBubblingCount).toBe(4);
@@ -560,19 +553,17 @@ describe('uiScroll', function () {
0 commit comments