rename renderlist 'query' option to 'selector'

for consistency with other APIs
This commit is contained in:
Geoff Schmidt
2011-12-09 23:37:50 -08:00
parent d73a647bdd
commit 5d172d0ded
2 changed files with 3 additions and 5 deletions

View File

@@ -117,7 +117,7 @@ $(function () {
// render individual todo list, stash kill function
current_list_stop =
Sky.ui.renderList(Todos, $('#item-list'), {
query: query,
selector: query,
sort: {timestamp: 1},
render: renderItem,
events: {}
@@ -126,7 +126,6 @@ $(function () {
// render list of lists in the left sidebar.
Sky.ui.renderList(Lists, $('#lists'), {
query: {}, // everything
sort: {name: 1},
template: $('#list-template'),
events: {
@@ -207,7 +206,6 @@ $(function () {
Session.set('tag_filter', null);
Sky.ui.renderList(LocalTags, $('#tag-filter'), {
query: {},
sort: {tag: 1},
template: $('#tag-filter-template'),
events: {

View File

@@ -115,7 +115,7 @@ Sky.ui.render = function (render_func, events, event_data) {
/// in which case the first element is used.
///
/// options to include:
/// query: minimongo selector (default: {})
/// selector: minimongo selector (default: {})
/// sort: minimongo sort specification (default: natural order)
/// render: render function (from object to element)
/// .. plus optionally
@@ -159,7 +159,7 @@ Sky.ui.renderList = function (collection, element, options) {
element.removeChild(element.childNodes[0]);
// XXX duplicated in sky_client.js (hook_handlebars_each)
var query = collection.findLive(options.query, {
var query = collection.findLive(options.selector, {
added: function (obj, before_idx) {
if (before_idx === element.childNodes.length)
element.appendChild(render(obj));