From 5d172d0deda41e1a28c596e59e937ab97136ef62 Mon Sep 17 00:00:00 2001 From: Geoff Schmidt Date: Fri, 9 Dec 2011 23:37:50 -0800 Subject: [PATCH] rename renderlist 'query' option to 'selector' for consistency with other APIs --- examples/unfinished/todos-underscore/client/client.js | 4 +--- packages/liveui/liveui.js | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/unfinished/todos-underscore/client/client.js b/examples/unfinished/todos-underscore/client/client.js index 7db455cb4a..d7b992c2a0 100644 --- a/examples/unfinished/todos-underscore/client/client.js +++ b/examples/unfinished/todos-underscore/client/client.js @@ -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: { diff --git a/packages/liveui/liveui.js b/packages/liveui/liveui.js index 341edd28a4..53bb79ea58 100644 --- a/packages/liveui/liveui.js +++ b/packages/liveui/liveui.js @@ -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));