Browse Source

meteor: option to specify collection selector

pull/493/head
Uros Smolnik 10 years ago
parent
commit
8510d422ff
  1. 14
      meteor/README.md
  2. 2
      meteor/reactivize.js

14
meteor/README.md

@ -81,6 +81,20 @@ Template.myTemplate.helpers({
});
```
#### meteor specific options
* `selector` - you can specify collection selector if your list operates only on subset of collection. Example:
```js
Template.myTemplate.helpers({
playerOptions: function() {
return {
selector: { city: 'San Francisco' }
}
}
});
```
## Events

2
meteor/reactivize.js

@ -90,7 +90,7 @@ Template.sortable.created = function () {
*/
templateInstance.adjustOrders = function adjustOrders(itemId, orderPrevItem, orderNextItem) {
var orderField = templateInstance.options.sortField;
var selector = {}, modifier = {$set: {}};
var selector = templateInstance.options.selector || {}, modifier = {$set: {}};
var ids = [];
var startOrder = templateInstance.collection.findOne(itemId)[orderField];
if (orderPrevItem !== null) {

Loading…
Cancel
Save