Skip to content

Commit a2ce8a2

Browse files
committed
1.7.0-rc.6
1 parent 13fce87 commit a2ce8a2

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

README.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ To use it in your angular-app you should add the module (modules)
132132
angular.module('application', ['ui.scroll', 'ui.scroll.grid'])
133133
```
134134

135-
Currently we have 2 regular modules which can be added to the angular-app you are developing.
135+
Currently we have 2 regular modules which can be added to the angular-app you are developing:
136136
- __ui.scroll__ module which has
137137
- [uiScroll directive](#uiscroll-directive)
138138
- [uiScrollViewport directive](#uiscrollviewport-directive)
@@ -141,7 +141,7 @@ Currently we have 2 regular modules which can be added to the angular-app you ar
141141
- [uiScrollTh directive](#uiscrollth-and-uiscrolltd-directives)
142142
- [uiScrollTd directive](#uiscrollth-and-uiscrolltd-directives)
143143

144-
Also there is one more additional module in a separate file
144+
Also, there is one more additional module in a separate file:
145145
- __ui.scroll.jqlite__ module (it is empty since it was deprecated in v1.6.0)
146146

147147

@@ -179,9 +179,9 @@ The `expression` can be any angular expression (assignable expression where so s
179179

180180
#### Assignable expressions
181181

182-
The `assignable expressions` will be used by scroller to inject the requested value into the target scope. The target scope locating is based on AngularJS $parse service. If the viewport is presented (the element marked with the uiScrollViewport directive), then the scope associated with the viewport will be a start point in the target scope locating. If not, the scope next to ui-scroll local scopes (ui-scroll parent scope) will be a start point.
182+
The `assignable expressions` will be used by scroller to inject the requested value into the target scope. The target scope locating is based on AngularJS $parse service. If the viewport is presented (the element marked with the uiScrollViewport directive), then the scope associated with the viewport will be a start point in the target scope locating. If not, the scope next to the ui-scroll local scopes (ui-scroll parent scope) will be a start point.
183183

184-
Please notice that property defined via `assignable expression` could be unavailable in case of nested scopes and non-explicit assignment. For example, if you want to have the Adapter on some controller's scope and there are intermediate scopes in between (obtained by ng-if or whatever), you should use Controller As syntax or explicitly define at least two-level object hierarchy on your controller:
184+
Please notice that properties defined via `assignable expression` could be unavailable in case of nested scopes and non-explicit assignment. For example, if you want to have the Adapter on some controller's scope and there are intermediate scopes in between (due to ng-if for example), you should use Controller As syntax or explicitly define at least two-level object hierarchy on your controller:
185185

186186
```
187187
<div ng-controller="MyController">
@@ -196,37 +196,40 @@ Please notice that property defined via `assignable expression` could be unavail
196196

197197
### Datasource
198198

199-
Data source is an object to be used by the uiScroll directive to access the data.
199+
Datasource is an object to be used by the uiScroll directive to access the data.
200200

201201
The directive will locate the object using the provided data source name. It will first look for a property with the given name on its
202202
$scope ([here](https://github.com/angular-ui/ui-scroll/blob/master/demo/scopeDatasource) is the example of
203203
scope-based datasource usage). If none found it will try to get an angular service with the provided name
204204
([here](https://github.com/angular-ui/ui-scroll/blob/master/demo/serviceDatasource) is the example of
205205
service-based datasource usage).
206206

207-
The data source object implements methods and properties to be used by the directive to access the data.
207+
The datasource object implements methods and properties to be used by the directive to access the data.
208208

209209
* Method `get`
210210

211-
get(descriptor, success)
212-
or
213-
214211
get(index, count, success)
212+
or
213+
214+
get(descriptor, success)
215215

216216
This is a mandatory method used by the directive to retrieve the data.
217217

218218
Parameters
219-
* **descriptor** is an object defining the portion of the dataset requested. The object will have 3 properties. Two of them named `index` and `count`. They have the same meaning as in the alternative signature when the parameters passed explicitly (see below). The third one will be named either `append` if the items will be appended to the last item in the buffer, or `prepend` if they are to be prepended to the first item in the buffer. The value of the property in either case will be the item the new items will be appended/prepended to. This is useful if it is easier to identify the items to be added based on the previously requested items rather than on the index. Keep in mind that in certain use cases (i.e. on initial load) the value of the append/prepend property can be undefined.
220-
* **index** indicates the first data row requested
221-
* **count** indicates number of data rows requested
219+
* **index** indicates the first data row requested.
220+
* **count** indicates number of data rows requested.
222221
* **success** function to call when the data are retrieved. The implementation of the data source has to call this function when the data are retrieved and pass it an array of the items retrieved. If no items are retrieved, an empty array has to be passed.
222+
* **descriptor** is an object defining the portion of the dataset requested. The object will have 3 properties. Two of them named `index` and `count`. They have the same meaning as in the alternative signature when the parameters passed explicitly (index-count based). The third one will be named either `append` if the items will be appended to the last item in the buffer, or `prepend` if they are to be prepended to the first item in the buffer. The value of the property in either case will be the item the new items will be appended/prepended to. This is useful if it is easier to identify the items to be added based on the previously requested items rather than on the index. Keep in mind that in certain use cases (i.e. on initial load) the value of the append/prepend property can be undefined.
223223

224224
_Important!_ Make sure to respect the `index` and `count` parameters of the request. The array passed to the success method should have
225225
exactly `count` elements unless it hit eof/bof.
226226

227227
* Properties `minIndex` and `maxIndex`
228228

229-
As the scroller receives 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 `maxIndex` 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.
229+
As the scroller receives 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. These values are used to maintain the appearance of the scrollbar. The values of the properties can be internaly changed by the ui-scroll engine in three cases:
230+
* reset both properties in response to a call to the adapter `reload` method;
231+
* increment `minIndex` in response to deleteing the topmost element via adapter `applyUpdates` method;
232+
* decrement `maxIndex` in response to deleteing anything other than the topmost element via adapter `applyUpdates` method.
230233

231234
Values of the properties can be assigned programmatically. If the range of the index values is known in advance, assigning them programmatically would improve the usability of the scrollBar.
232235

@@ -479,7 +482,11 @@ PR should include source code (./scr) changes, may include tests (./test) change
479482

480483
### v1.7.0
481484
* Reduced dygest cycles amount.
482-
* Refactored tests (removed timeouts).
485+
* Refactored Adapter and Padding classes.
486+
* Reconsidered min/max indices processing.
487+
* Refactored tests (removed timeouts, added helpers).
488+
* Added ~50 new tests.
489+
* Fixed a number of issues.
483490

484491
### v1.6.2
485492
* Added bottomVisible, bottomVisibleElement and bottomVisibleScope properties to the Adapter.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-ui-scroll",
33
"description": "AngularJS infinite scrolling module",
4-
"version": "1.7.0-rc.5",
4+
"version": "1.7.0-rc.6",
55
"main": "./dist/ui-scroll.js",
66
"homepage": "https://github.com/angular-ui/ui-scroll.git",
77
"license": "MIT",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-ui-scroll",
33
"description": "AngularJS infinite scrolling module",
4-
"version": "1.7.0-rc.5",
4+
"version": "1.7.0-rc.6",
55
"src": "./src/",
66
"public": "./dist/",
77
"main": "./dist/ui-scroll.js",

0 commit comments

Comments
 (0)