diff --git a/meteor/README.md b/meteor/README.md index c340358..e5cacc3 100644 --- a/meteor/README.md +++ b/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 diff --git a/meteor/reactivize.js b/meteor/reactivize.js index a068a5e..42a4bef 100644 --- a/meteor/reactivize.js +++ b/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) {